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,16 +46,20 @@ class Repo:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
self.logging.info("Creating reprepro configuration.")
|
self.logging.info("Creating reprepro configuration.")
|
||||||
config.write_text(
|
try:
|
||||||
textwrap.dedent(f"""\
|
config.write_text(
|
||||||
Origin: {self.state.origin}
|
textwrap.dedent(f"""\
|
||||||
Label: {self.label}
|
Origin: {self.state.origin}
|
||||||
Codename: {self.state.release}
|
Label: {self.label}
|
||||||
Architectures: amd64
|
Codename: {self.state.release}
|
||||||
Components: {self.state.origin}
|
Architectures: amd64
|
||||||
Description: {self.description}
|
Components: {self.state.origin}
|
||||||
""")
|
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