Search in sources :

Example 1 with VSphereGuestInfoProperty

use of org.jenkinsci.plugins.vsphere.VSphereGuestInfoProperty in project vsphere-cloud-plugin by jenkinsci.

the class vSphereCloudSlaveTemplate method calculateExtraConfigParameters.

private Map<String, String> calculateExtraConfigParameters(final String cloneName, final TaskListener listener) throws IOException, InterruptedException {
    final EnvVars knownVariables = calculateVariablesForGuestInfo(cloneName, listener);
    final Map<String, String> result = new LinkedHashMap<String, String>();
    final String jenkinsUrl = Jenkins.getActiveInstance().getRootUrl();
    if (jenkinsUrl != null) {
        result.put(VSPHERE_ATTR_FOR_JENKINSURL, jenkinsUrl);
    }
    List<? extends VSphereGuestInfoProperty> guestInfoConfig = this.guestInfoProperties;
    if (guestInfoConfig == null) {
        guestInfoConfig = Collections.emptyList();
    }
    for (final VSphereGuestInfoProperty property : guestInfoConfig) {
        final String name = property.getName();
        final String configuredValue = property.getValue();
        final String resolvedValue = Util.replaceMacro(configuredValue, knownVariables);
        result.put("guestinfo." + name, resolvedValue);
    }
    return result;
}
Also used : EnvVars(hudson.EnvVars) VSphereGuestInfoProperty(org.jenkinsci.plugins.vsphere.VSphereGuestInfoProperty) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

EnvVars (hudson.EnvVars)1 LinkedHashMap (java.util.LinkedHashMap)1 VSphereGuestInfoProperty (org.jenkinsci.plugins.vsphere.VSphereGuestInfoProperty)1