Source:
<code>private int outputDeployment(Configuration config) { try { File configInfoDir = new VoltFile(config.m_voltdbRoot, Constants.CONFIG_DIR); File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.isFile() || !depFH.canRead()) { <START> hostLog.fatal("Failed to get configuration or deployment configuration is invalid. " <END> + depFH.getAbsolutePath()); return -1; } config.m_pathToDeployment = depFH.getCanonicalPath(); } catch (IOException e) { hostLog.fatal("Failed to read deployment: " + e.getMessage()); return -1; } ReadDeploymentResults readDepl = readPrimedDeployment(config); try { DeploymentType dt = CatalogUtil.updateRuntimeDeploymentPaths(readDepl.deployment); String out; if ((out = CatalogUtil.getDeployment(dt, true)) != null) { if ((new File(config.m_getOutput)).exists() && !config.m_forceGetCreate) { hostLog.fatal("Failed to save deployment, file already exists: " + config.m_getOutput); return -1; } try (FileOutputStream fos = new FileOutputStream(config.m_getOutput.trim())){ fos.write(out.getBytes()); } catch (IOException e) { hostLog.fatal("Failed to write deployment to " + config.m_getOutput + " : " + e.getMessage()); return -1; } hostLog.info("Deployment configuration saved at " + config.m_getOutput.trim()); } else { hostLog.fatal("Failed to get configuration or deployment configuration is invalid."); return -1; } } catch (Exception e) { hostLog.fatal("Failed to get configuration or deployment configuration is invalid. " + "Please make sure voltdbroot is a valid directory. " + e.getMessage()); return -1; } return 0; }</code><technical_language>consoleLog</technical_language>

Target:
private int outputDeployment(Configuration config) { try { File configInfoDir = new VoltFile(config.m_voltdbRoot, Constants.CONFIG_DIR); File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.isFile() || !depFH.canRead()) { consoleLog.fatal("Failed to get configuration or deployment configuration is invalid. " + depFH.getAbsolutePath()); return -1; } config.m_pathToDeployment = depFH.getCanonicalPath(); } catch (IOException e) { consoleLog.fatal("Failed to read deployment: " + e.getMessage()); return -1; } ReadDeploymentResults readDepl = readPrimedDeployment(config); try { DeploymentType dt = CatalogUtil.updateRuntimeDeploymentPaths(readDepl.deployment); String out; if ((out = CatalogUtil.getDeployment(dt, true)) != null) { if ((new File(config.m_getOutput)).exists() && !config.m_forceGetCreate) { consoleLog.fatal("Failed to save deployment, file already exists: " + config.m_getOutput); return -1; } try (FileOutputStream fos = new FileOutputStream(config.m_getOutput.trim())){ fos.write(out.getBytes()); } catch (IOException e) { consoleLog.fatal("Failed to write deployment to " + config.m_getOutput + " : " + e.getMessage()); return -1; } consoleLog.info("Deployment configuration saved at " + config.m_getOutput.trim()); } else { consoleLog.fatal("Failed to get configuration or deployment configuration is invalid."); return -1; } } catch (Exception e) { consoleLog.fatal("Failed to get configuration or deployment configuration is invalid. " + "Please make sure voltdbroot is a valid directory. " + e.getMessage()); return -1; } return 0; }