Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Return empty list when there is no content in res_ks_list #302

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/mrack/transformers/beaker.py
Original file line number Diff line number Diff line change
@@ -152,9 +152,7 @@ def _construct_ks_append_script(self, ks_append, pubkeys=None):
if pubkeys:
res_ks_list += ["%post"] + self._allow_ssh_keys(pubkeys) + ["%end"]

return [
"\n".join(res_ks_list),
]
return ["\n".join(res_ks_list)] if res_ks_list else []

def _allow_ssh_keys(self, pubkeys):
"""Create ssh key content to be injected to xml."""