Merge "Fix deploy host for in-service patch"

This commit is contained in:
Zuul 2024-03-19 18:04:59 +00:00 committed by Gerrit Code Review
commit 75de9f16ff
1 changed files with 19 additions and 10 deletions

View File

@ -1,5 +1,5 @@
"""
Copyright (c) 2023 Wind River Systems, Inc.
Copyright (c) 2024 Wind River Systems, Inc.
SPDX-License-Identifier: Apache-2.0
@ -71,7 +71,10 @@ def clearflag(fname):
def pull_restart_scripts_from_controller():
# If the rsync fails, it raises an exception to
# the caller "handle_install()" and fails the
# host-install request for this host
# host-install request for this host.
# The restart_scripts are optional, so if the files
# are not present, it should not raise any exception
try:
output = subprocess.check_output(["rsync",
"-acv",
"--delete",
@ -80,6 +83,12 @@ def pull_restart_scripts_from_controller():
"%s/" % insvc_software_scripts],
stderr=subprocess.STDOUT)
LOG.info("Synced restart scripts from controller: %s", output)
except subprocess.CalledProcessError as e:
if "No such file or directory" in e.output.decode("utf-8"):
LOG.info("No restart scripts contained in the release")
else:
LOG.exception("Failed to sync restart scripts from controller")
raise
def check_install_uuid():