use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class ClusterAddressPoller method setLocalRepoControllerProps.
/**
* Set controller properties in local repository
*
* @param props properties to set
* @throws LocalRepositoryException
*/
private void setLocalRepoControllerProps(Map<String, String> props) throws LocalRepositoryException {
PropertyInfoExt controllerProps = getLocalRepository().getControllerOvfProperties();
controllerProps.removeProperties(props.keySet());
controllerProps.addProperties(props);
getLocalRepository().setControllerOvfProperties(controllerProps);
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class PropertyInfoTest method testGetTargetProps.
@Test
public void testGetTargetProps() {
Map<String, String> map = new HashMap<String, String>();
map.put("node_id", "node2");
map.put("system_connectemc_username", "username");
map.put("version", "");
PropertyInfoExt propertyInfo = new PropertyInfoExt(map);
Map<String, String> targetProps = propertyInfo.getAllProperties();
Assert.assertEquals("username", targetProps.get("system_connectemc_username"));
Assert.assertEquals("node2", targetProps.get("node_id"));
Assert.assertEquals("", targetProps.get("version"));
Assert.assertNull(targetProps.get("nonExistant"));
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class LocalRepository method getOverrideProperties.
/**
* @return PropertyInfo
*/
public PropertyInfoExt getOverrideProperties() throws LocalRepositoryException {
final String prefix = "getOverrideProperties(): ";
_log.debug(prefix);
final String[] cmd = { _SYSTOOL_CMD, _SYSTOOL_GET_OPROPS };
PropertyInfoExt overrides = new PropertyInfoExt(exec(prefix, cmd));
_log.debug(prefix + "properties={}", Strings.repr(overrides));
return overrides;
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class ZkCmdHandler method rollbackDataRevision.
public void rollbackDataRevision() throws Exception {
DrUtil drUtil = new DrUtil(ZKUtil.getCoordinatorClient());
if (!precheckForRollback(drUtil)) {
return;
}
LocalRepository localRepository = LocalRepository.getInstance();
PropertyInfoExt localDataRevisionProps = localRepository.getDataRevisionPropertyInfo();
String prevRevision = localDataRevisionProps.getProperty(Constants.KEY_PREV_DATA_REVISION);
log.info("Previous data revision at local {}", prevRevision);
if (StringUtils.isNotEmpty(prevRevision)) {
long rollbackTargetRevision = Long.parseLong(prevRevision);
drUtil.updateVdcTargetVersion(drUtil.getLocalSite().getUuid(), SiteInfo.DR_OP_CHANGE_DATA_REVISION, DrUtil.newVdcConfigVersion(), rollbackTargetRevision);
log.info("Manual rollback to {} has been triggered", rollbackTargetRevision);
System.out.println(String.format("Rollback to %s has been initiated successfully", prevRevision));
} else {
log.warn("No valid previous revision found. Skip rollback");
System.out.println("Can't find viable previous data revision. Rollback oparation has been aborted");
}
}
use of com.emc.storageos.coordinator.client.model.PropertyInfoExt in project coprhd-controller by CoprHD.
the class ComputeImageServerMigrationTest method prepareData.
@Override
protected void prepareData() throws Exception {
log.info("Storing image server info into zk configuration");
Map<String, String> imageServerProps = new HashMap<String, String>();
imageServerProps.put("image_server_address", "10.247.84.185");
imageServerProps.put("image_server_username", "root");
imageServerProps.put("image_server_password", "ChangeMe");
imageServerProps.put("image_server_tftpbootdirectory", "");
imageServerProps.put("image_server_os_network_ip", "12.0.6.10");
imageServerProps.put("image_server_http_port", "");
imageServerProps.put("image_server_image_directory", "");
String str = new PropertyInfoExt(imageServerProps).encodeAsString();
ConfigurationImpl config = new ConfigurationImpl();
config.setKind(PropertyInfoExt.TARGET_PROPERTY);
config.setId(PropertyInfoExt.TARGET_PROPERTY_ID);
config.setConfig(PropertyInfoExt.TARGET_INFO, str);
_coordinator.persistServiceConfiguration(_coordinator.getSiteId(), config);
String imageServerIP = _coordinator.getPropertyInfo().getProperty("image_server_address");
if (imageServerIP == null) {
log.info("image server info not saved to ZK db");
}
}
Aggregations