Improving reprepro distributions config file creation
This commit introduces try-catch statement to caputre any errors during creation of distributions config file. PASS: Run software-controller-init.sh and check user.log Story: 2010676 Task: 51179 Change-Id: I78d8b9e9da5f28e622da72a4c7fb3b6897bb8020 Signed-off-by: sshathee <shunmugam.shatheesh@windriver.com>
This commit is contained in:
@@ -46,6 +46,7 @@ class Repo:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
self.logging.info("Creating reprepro configuration.")
|
self.logging.info("Creating reprepro configuration.")
|
||||||
|
try:
|
||||||
config.write_text(
|
config.write_text(
|
||||||
textwrap.dedent(f"""\
|
textwrap.dedent(f"""\
|
||||||
Origin: {self.state.origin}
|
Origin: {self.state.origin}
|
||||||
@@ -56,6 +57,9 @@ class Repo:
|
|||||||
Description: {self.description}
|
Description: {self.description}
|
||||||
""")
|
""")
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
self.logging.error("Error writing distributions \
|
||||||
|
config file: %s" % str(e))
|
||||||
options = self.repo.joinpath("options")
|
options = self.repo.joinpath("options")
|
||||||
if not options.exists():
|
if not options.exists():
|
||||||
options.write_text(
|
options.write_text(
|
||||||
|
Reference in New Issue
Block a user