@Override public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof NovaTemplateOptions) { NovaTemplateOptions eTo = NovaTemplateOptions.class.cast(to); eTo.autoAssignFloatingIp(shouldAutoAssignFloatingIp()); if (getSecurityGroupNames().isPresent()) eTo.securityGroupNames(getSecurityGroupNames().get()); eTo.generateKeyPair(shouldGenerateKeyPair()); eTo.keyPairName(getKeyPairName()); if (getUserData() != null) { eTo.userData(getUserData()); } } }
@Override public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof NovaTemplateOptions) { NovaTemplateOptions eTo = NovaTemplateOptions.class.cast(to); eTo.autoAssignFloatingIp(shouldAutoAssignFloatingIp()); if (getSecurityGroupNames().isPresent()) eTo.securityGroupNames(getSecurityGroupNames().get()); eTo.generateKeyPair(shouldGenerateKeyPair()); eTo.keyPairName(getKeyPairName()); if (getUserData() != null) { eTo.userData(getUserData()); } } }
templateOptions.keyPairName(keyPair.getName()); tagsBuilder.add(JCLOUDS_KP); } else if (templateOptions.getKeyPairName() != null) { checkArgument(keyPairExtensionPresent, "Key Pairs are required by options, but the extension is not available! options: %s", templateOptions); if (templateOptions.getLoginPrivateKey() != null) { String pem = templateOptions.getLoginPrivateKey(); KeyPair keyPair = KeyPair.builder().name(templateOptions.getKeyPairName()) .fingerprint(fingerprintPrivateKey(pem)).privateKey(pem).build(); keyPairCache.asMap().put(RegionAndName.fromRegionAndName(region, keyPair.getName()), keyPair);
keyPairCache.asMap().put(ZoneAndName.fromZoneAndName(zone, keyPair.getName()), keyPair); templateOptions.keyPairName(keyPair.getName()); } else if (templateOptions.getKeyPairName() != null) { checkArgument(keyPairExtensionPresent, "Key Pairs are required by options, but the extension is not available! options: %s", templateOptions); if (templateOptions.getLoginPrivateKey() != null) { String pem = templateOptions.getLoginPrivateKey(); KeyPair keyPair = KeyPair.builder().name(templateOptions.getKeyPairName()) .fingerprint(fingerprintPrivateKey(pem)).privateKey(pem).build(); keyPairCache.asMap().put(ZoneAndName.fromZoneAndName(zone, keyPair.getName()), keyPair);
keyPairCache.asMap().put(ZoneAndName.fromZoneAndName(zone, keyPair.getName()), keyPair); templateOptions.keyPairName(keyPair.getName()); } else if (templateOptions.getKeyPairName() != null) { checkArgument(keyPairExtensionPresent, "Key Pairs are required by options, but the extension is not available! options: %s", templateOptions); if (templateOptions.getLoginPrivateKey() != null) { String pem = templateOptions.getLoginPrivateKey(); KeyPair keyPair = KeyPair.builder().name(templateOptions.getKeyPairName()) .fingerprint(fingerprintPrivateKey(pem)).privateKey(pem).build(); keyPairCache.asMap().put(ZoneAndName.fromZoneAndName(zone, keyPair.getName()), keyPair);
templateOptions); if (templateOptions.shouldGenerateKeyPair() || templateOptions.getKeyPairName() != null) { checkArgument(novaApi.getKeyPairApi(region).isPresent(), "Key Pairs are required by options, but the extension is not available! options: %s", templateOptions); templateOptions.overrideLoginPrivateKey(keyPair.getPrivateKey()); } else if (templateOptions.getKeyPairName() != null) { keyPair = checkNotNull(novaApi.getKeyPairApi(region).get().get(templateOptions.getKeyPairName()), "keypair %s doesn't exist", templateOptions.getKeyPairName());
keyPairCache.asMap().put(ZoneAndName.fromZoneAndName(zone, keyPair.getName()), keyPair); templateOptions.keyPairName(keyPair.getName()); } else if (templateOptions.getKeyPairName() != null) { checkArgument(keyPairExtensionPresent, "Key Pairs are required by options, but the extension is not available! options: %s", templateOptions); if (templateOptions.getLoginPrivateKey() != null) { String pem = templateOptions.getLoginPrivateKey(); KeyPair keyPair = KeyPair.builder().name(templateOptions.getKeyPairName()) .fingerprint(fingerprintPrivateKey(pem)).privateKey(pem).build(); keyPairCache.asMap().put(ZoneAndName.fromZoneAndName(zone, keyPair.getName()), keyPair);
templateOptions); if (templateOptions.shouldGenerateKeyPair() || templateOptions.getKeyPairName() != null) { checkArgument(novaApi.getKeyPairApi(region).isPresent(), "Key Pairs are required by options, but the extension is not available! options: %s", templateOptions); templateOptions.overrideLoginPrivateKey(keyPair.getPrivateKey()); } else if (templateOptions.getKeyPairName() != null) { keyPair = checkNotNull(novaApi.getKeyPairApi(region).get().get(templateOptions.getKeyPairName()), "keypair %s doesn't exist", templateOptions.getKeyPairName());
@Override public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof NovaTemplateOptions) { NovaTemplateOptions eTo = NovaTemplateOptions.class.cast(to); eTo.autoAssignFloatingIp(shouldAutoAssignFloatingIp()); if (getSecurityGroupNames().isPresent()) eTo.securityGroupNames(getSecurityGroupNames().get()); eTo.generateKeyPair(shouldGenerateKeyPair()); eTo.keyPairName(getKeyPairName()); if (getUserData() != null) { eTo.userData(getUserData()); } if (getDiskConfig() != null) { eTo.diskConfig(getDiskConfig()); } eTo.configDrive(getConfigDrive()); } }
if (templateOptions.getKeyPairName() != null) { options.keyPairName(templateOptions.getKeyPairName()); KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName())); if (keyPair != null && keyPair.getPrivateKey() != null) { privateKey = Optional.of(keyPair.getPrivateKey());
@Override public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof NovaTemplateOptions) { NovaTemplateOptions eTo = NovaTemplateOptions.class.cast(to); eTo.autoAssignFloatingIp(shouldAutoAssignFloatingIp()); if (getFloatingIpPoolNames().isPresent()) eTo.floatingIpPoolNames(getFloatingIpPoolNames().get()); if (getSecurityGroupNames().isPresent()) eTo.securityGroupNames(getSecurityGroupNames().get()); eTo.generateKeyPair(shouldGenerateKeyPair()); eTo.keyPairName(getKeyPairName()); if (getUserData() != null) { eTo.userData(getUserData()); } if (getDiskConfig() != null) { eTo.diskConfig(getDiskConfig()); } eTo.configDrive(getConfigDrive()); eTo.novaNetworks(getNovaNetworks()); eTo.availabilityZone(getAvailabilityZone()); } }
if (templateOptions.getKeyPairName() != null) { options.keyPairName(templateOptions.getKeyPairName()); KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName())); if (keyPair != null && keyPair.getPrivateKey() != null) { privateKey = Optional.of(keyPair.getPrivateKey());
if (templateOptions.getKeyPairName() != null) { options.keyPairName(templateOptions.getKeyPairName()); KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName())); if (keyPair != null && keyPair.getPrivateKey() != null) { privateKey = Optional.of(keyPair.getPrivateKey());
@Override public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof NovaTemplateOptions) { NovaTemplateOptions eTo = NovaTemplateOptions.class.cast(to); eTo.autoAssignFloatingIp(shouldAutoAssignFloatingIp()); if (getFloatingIpPoolNames().isPresent()) eTo.floatingIpPoolNames(getFloatingIpPoolNames().get()); eTo.generateKeyPair(shouldGenerateKeyPair()); eTo.keyPairName(getKeyPairName()); if (getUserData() != null) { eTo.userData(getUserData()); } if (getDiskConfig() != null) { eTo.diskConfig(getDiskConfig()); } eTo.configDrive(getConfigDrive()); eTo.novaNetworks(getNovaNetworks()); eTo.availabilityZone(getAvailabilityZone()); eTo.blockDeviceMappings(getBlockDeviceMappings()); } }
@Override public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof NovaTemplateOptions) { NovaTemplateOptions eTo = NovaTemplateOptions.class.cast(to); eTo.autoAssignFloatingIp(shouldAutoAssignFloatingIp()); if (getFloatingIpPoolNames().isPresent()) eTo.floatingIpPoolNames(getFloatingIpPoolNames().get()); eTo.generateKeyPair(shouldGenerateKeyPair()); eTo.keyPairName(getKeyPairName()); if (getUserData() != null) { eTo.userData(getUserData()); } if (getDiskConfig() != null) { eTo.diskConfig(getDiskConfig()); } eTo.configDrive(getConfigDrive()); eTo.novaNetworks(getNovaNetworks()); eTo.availabilityZone(getAvailabilityZone()); eTo.blockDeviceMappings(getBlockDeviceMappings()); } }
if (templateOptions.getKeyPairName() != null) { options.keyPairName(templateOptions.getKeyPairName());
if (templateOptions.getKeyPairName() != null) { options.keyPairName(templateOptions.getKeyPairName());
if (templateOptions.getKeyPairName() != null) { options.keyPairName(templateOptions.getKeyPairName()); KeyPair keyPair = keyPairCache.getIfPresent(RegionAndName.fromRegionAndName(template.getLocation().getId(), templateOptions.getKeyPairName())); if (keyPair != null && keyPair.getPrivateKey() != null) { privateKey = Optional.of(keyPair.getPrivateKey());