Fix logic

This commit is contained in:
Troy Dawson 2023-02-27 10:23:31 -08:00
parent 315e8a0cdd
commit 24b8461cb3

View file

@ -152,7 +152,6 @@ class centpkgClient(cliClient):
build_parser.add_argument(
'--rhel-target',
choices=['exception', 'zstream', 'latest'],
default='latest',
help='Set the rhel-target metadata')
# Overloaded _build
@ -182,13 +181,13 @@ class centpkgClient(cliClient):
# Good to know
if divergent_branch :
self.log.info(" A divergent branch was found.")
self.log.info(" a divergent branch was found.")
else:
self.log.info(" A divergent branch was not found.")
self.log.info(" a divergent branch was not found.")
if in_stabilization :
self.log.info(" We are in stabilization mode.")
self.log.info(" we are in stabilization mode.")
else:
self.log.info(" We are not in stabilization mode.")
self.log.info(" we are not in stabilization mode.")
# Update args.custom_user_metadata
if hasattr(self.args, 'custom_user_metadata') and self.args.custom_user_metadata:
@ -202,7 +201,7 @@ class centpkgClient(cliClient):
if hasattr(self.args, 'rhel_target') and self.args.rhel_target:
temp_custom_user_metadata["rhel-target"] = self.args.rhel_target
else:
if divergent_branch and not in_stabilization :
if divergent_branch:
temp_custom_user_metadata["rhel-target"] = "latest"
elif not divergent_branch and not in_stabilization :
temp_custom_user_metadata["rhel-target"] = "zstream"
@ -218,7 +217,7 @@ class centpkgClient(cliClient):
temp_custom_user_metadata = {"rhel-target": self.args.rhel_target}
self.args.custom_user_metadata = json.dumps(temp_custom_user_metadata)
else:
if divergent_branch and not in_stabilization :
if divergent_branch:
self.args.custom_user_metadata = '{"rhel-target": "latest"}'
elif not divergent_branch and not in_stabilization :
self.args.custom_user_metadata = '{"rhel-target": "zstream"}'