use of com.emc.storageos.systemservices.exceptions.CoordinatorClientException in project coprhd-controller by CoprHD.
the class LocalPasswordHandler method getPassword.
private String getPassword(String username) throws CoordinatorClientException, LocalRepositoryException {
PropertyInfoRestRep props = null;
try {
props = _cfg.getProperties(PropCategory.CONFIG.toString());
} catch (Exception e) {
throw APIException.internalServerErrors.getObjectFromError("password", "coordinator", e);
}
String propertyKey = String.format(SYSTEM_ENCPASSWORD_FORMAT, username);
String oldPassword = props.getProperty(propertyKey);
if (oldPassword == null) {
_log.error("password not found for " + username);
return "";
}
return oldPassword;
}
use of com.emc.storageos.systemservices.exceptions.CoordinatorClientException in project coprhd-controller by CoprHD.
the class PropertyManager method initializeLocalAndTargetInfo.
/**
* Initialize local and target info
*
* @throws Exception
*/
private void initializeLocalAndTargetInfo(String svcId) throws Exception {
// publish config_version which is also a target property
// used as a flag denoting whether target properties have been changed
PropertyInfoExt localPropInfo = localRepository.getOverrideProperties();
localConfigVersion = localPropInfo.getProperty(PropertyInfoExt.CONFIG_VERSION);
if (localConfigVersion == null) {
localConfigVersion = "0";
localPropInfo.addProperty(PropertyInfoExt.CONFIG_VERSION, localConfigVersion);
}
coordinator.setNodeSessionScopeInfo(new ConfigVersion(localConfigVersion));
log.info("Step1a: Local config version: {}", localConfigVersion);
// get local target property info
localTargetPropInfo = getLocalTargetPropInfo(localPropInfo);
log.debug("Step1a: Local target properties: {}", localTargetPropInfo);
// set target if empty
targetPropInfo = coordinator.getTargetProperties();
if (targetPropInfo == null) {
// only control node can set target
try {
// Set the updated propperty info in coordinator
coordinator.setTargetProperties(localPropInfo.getAllProperties());
coordinator.setTargetInfo(new PowerOffState(PowerOffState.State.NONE));
targetPropInfo = coordinator.getTargetInfo(PropertyInfoExt.class);
log.info("Step1b: Target property set to local state: {}", targetPropInfo);
} catch (CoordinatorClientException e) {
log.info("Step1b: Wait another control node to set target");
retrySleep();
throw e;
}
}
}
Aggregations