registerLicenses/trialLicenses should return currentCLusterState if not modified

Original commit: elastic/x-pack-elasticsearch@b8432ed988
This commit is contained in:
Areek Zillur 2014-10-30 17:45:57 -04:00
parent 1b9f069837
commit 34679d3e47
1 changed files with 4 additions and 6 deletions

View File

@ -125,10 +125,9 @@ public class LicensesService extends AbstractLifecycleComponent<LicensesService>
if (newLicenseSignatures.size() != licensesWrapper.signatures.size()) {
LicensesMetaData newLicensesMetaData = new LicensesMetaData(newLicenseSignatures, licensesWrapper.encodedTrialLicenses);
mdBuilder.putCustom(LicensesMetaData.TYPE, newLicensesMetaData);
} else {
mdBuilder.putCustom(LicensesMetaData.TYPE, currentLicenses);
return ClusterState.builder(currentState).metaData(mdBuilder).build();
}
return ClusterState.builder(currentState).metaData(mdBuilder).build();
return currentState;
}
});
} else {
@ -284,10 +283,9 @@ public class LicensesService extends AbstractLifecycleComponent<LicensesService>
final LicensesMetaData newLicensesMetaData = new LicensesMetaData(
licensesWrapper.signatures, newTrialLicenses);
mdBuilder.putCustom(LicensesMetaData.TYPE, newLicensesMetaData);
} else {
mdBuilder.putCustom(LicensesMetaData.TYPE, currentLicensesMetaData);
return ClusterState.builder(currentState).metaData(mdBuilder).build();
}
return ClusterState.builder(currentState).metaData(mdBuilder).build();
return currentState;
}
@Override