Skip to content
New issue

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

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

Already on GitHub? # to your account

Add --keep-locked option #89

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Add --keep-locked option #89

merged 1 commit into from
Apr 14, 2022

Conversation

LegenJCdary
Copy link
Collaborator

fixing issue #87

@LegenJCdary LegenJCdary force-pushed the keep_locked_switch branch 2 times, most recently from 2d841e3 to 77703c8 Compare April 7, 2022 11:19
@LegenJCdary LegenJCdary requested a review from cinek810 April 7, 2022 11:20
@@ -541,7 +544,11 @@ def run_playitem(config: dict, options: dict, inventory: str, lockpath: str):
logger.error("'%s' failed due to:", command)
for line in std_e.split(b"\n\n"):
logger.error(line.decode("utf-8"))
unlock_inventory(lockpath)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that the whole try block should go to sparate function to reduc e number of branches?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just put this in unloc_inventory to avoid code duplication, just pass it a bool options["keep_locked"]

tests/pylintrc Outdated
@@ -518,7 +518,7 @@ max-attributes=7
max-bool-expr=5

# Maximum number of branch for function / method body.
max-branches=16
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w can't continue increasing it, we need to work on that to decrase the branches

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I'll do that with #84

@LegenJCdary LegenJCdary requested a review from cinek810 April 8, 2022 07:49
@LegenJCdary LegenJCdary force-pushed the keep_locked_switch branch 2 times, most recently from ad47937 to dd46453 Compare April 8, 2022 10:49
logger.critical(exc)
sys.exit(64)
else:
logger.debug("Requested infra %s:%s remains locked.", options["infra"], options["stage"])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, it will be easier (for me) to understand message refering to '--keep-locked' option

@LegenJCdary LegenJCdary merged commit f0ecf9a into main Apr 14, 2022
@LegenJCdary LegenJCdary deleted the keep_locked_switch branch April 14, 2022 06:32
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants