Source:
<code>public Map<String, byte[]> getFileData() throws UnsupportedEncodingException, IOException, JsonGenerationException, JsonMappingException { if (vmInit != null) { try { storeHostname(); storeAuthorizedKeys(); storeRegenerateKeys(); storeNetwork(); storeTimeZone(); storeRootPassword(); storeUserName(); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException("Malformed input", ex); } } storeExecutionParameters(); String metaDataStr = mapToJson(metaData); String userDataStr = mapToYaml(userData); String networkDataStr = !MapUtils.isEmpty(networkData) ? mapToJson(networkData) : ""; if (vmInit != null && vmInit.getCustomScript() != null) { userDataStr += vmInit.getCustomScript(); } if (StringUtils.isNotBlank(userDataStr)) { userDataStr = "#cloud-config\n" + userDataStr; } files.put("openstack/latest/meta_data.json", metaDataStr.getBytes("UTF-8")); files.put("openstack/latest/user_data", userDataStr.getBytes("UTF-8")); if <START> (isOpenstackMetadataProtocol() <END> && !StringUtils.isEmpty(networkDataStr)) { files.put("openstack/latest/network_data.json", networkDataStr.getBytes("UTF-8")); } if (metaDataStr.contains(passwordKey) && vmInit != null && vmInit.getRootPassword() != null) { String oldStr = String.format("\"%s\" : \"%s\"", passwordKey, vmInit.getRootPassword()); String newStr = String.format("\"%s\" : ***", passwordKey); metaDataStr = metaDataStr.replace(oldStr, newStr); } log.debug("cloud-init meta-data:\n{}", metaDataStr); log.debug("cloud-init user-data:\n{}", userDataStr); if (isOpenstackMetadataProtocol()) { log.debug("cloud-init network-data:\n{}", networkDataStr); } return files; }</code><technical_language>related this change, is allowed call isOpenstackMetadataProtocol if vmInit==null</technical_language>

Target:
public Map<String, byte[]> getFileData() throws UnsupportedEncodingException, IOException, JsonGenerationException, JsonMappingException { if (vmInit != null) { try { storeHostname(); storeAuthorizedKeys(); storeRegenerateKeys(); storeNetwork(); storeTimeZone(); storeRootPassword(); storeUserName(); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException("Malformed input", ex); } } storeExecutionParameters(); String metaDataStr = mapToJson(metaData); String userDataStr = mapToYaml(userData); String networkDataStr = !MapUtils.isEmpty(networkData) ? mapToJson(networkData) : ""; if (vmInit != null && vmInit.getCustomScript() != null) { userDataStr += vmInit.getCustomScript(); } if (StringUtils.isNotBlank(userDataStr)) { userDataStr = "#cloud-config\n" + userDataStr; } files.put("openstack/latest/meta_data.json", metaDataStr.getBytes("UTF-8")); files.put("openstack/latest/user_data", userDataStr.getBytes("UTF-8")); if (!StringUtils.isEmpty(networkDataStr) && isOpenstackMetadataProtocol()) { files.put("openstack/latest/network_data.json", networkDataStr.getBytes("UTF-8")); log.debug("cloud-init network_data.json:\n{}", networkDataStr); } if (metaDataStr.contains(passwordKey) && vmInit != null && vmInit.getRootPassword() != null) { String oldStr = String.format("\"%s\" : \"%s\"", passwordKey, vmInit.getRootPassword()); String newStr = String.format("\"%s\" : ***", passwordKey); metaDataStr = metaDataStr.replace(oldStr, newStr); } log.debug("cloud-init meta-data:\n{}", metaDataStr); log.debug("cloud-init user-data:\n{}", userDataStr); return files; }