in sdw_updater/Updater.py [0:0]
def run_full_install():
"""
Re-apply the entire Salt config via sdw-admin. Required to enforce
VM state during major migrations, such as template consolidation.
"""
sdlog.info("Running 'sdw-admin --apply' to apply full system state")
apply_cmd = ["sdw-admin", "--apply"]
apply_cmd_for_log = (" ").join(apply_cmd)
try:
output = subprocess.check_output(apply_cmd)
except subprocess.CalledProcessError as e:
sdlog.error(f"Failed to apply full system state. Please review {DETAIL_LOG_FILE}.")
sdlog.error(str(e))
clean_output = Util.strip_ansi_colors(e.output.decode("utf-8").strip())
detail_log.error(f"Output from failed command: {apply_cmd_for_log}\n{clean_output}")
return UpdateStatus.UPDATES_FAILED
clean_output = Util.strip_ansi_colors(output.decode("utf-8").strip())
detail_log.info(f"Output from command: {apply_cmd_for_log}\n{clean_output}")
# Clean up flag requesting migration. Shell out since root created it.
rm_flag_cmd = ["sudo", "rm", "-rf", MIGRATION_DIR]
try:
subprocess.check_call(rm_flag_cmd)
except subprocess.CalledProcessError as e:
sdlog.error("Failed to remove migration flag.")
sdlog.error(str(e))
return UpdateStatus.UPDATES_FAILED
sdlog.info("Full system state successfully applied and migration flag cleared.")
return UpdateStatus.UPDATES_OK