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

fix: add manage-sources-list-d CLI option (LP:2077360) ; refactor: optparse to argparse for CLI options #265

Merged
merged 8 commits into from
Sep 6, 2024

Conversation

HJK-X
Copy link
Contributor

@HJK-X HJK-X commented Aug 30, 2024

Refactor optparse to argparse. Should be mostly a drop-in replacement except for positional arguments (which were previously ignored).

https://bugs.launchpad.net/landscape-client/+bug/2077360

To create similar functionality for --manage-sources-list-d as described in the report, landscape-config will parse the terminal command with an optional argument for t/f values.

@HJK-X HJK-X marked this pull request as ready for review September 5, 2024 16:25
@srunde3 srunde3 self-requested a review September 5, 2024 19:08
Copy link
Contributor

@srunde3 srunde3 left a comment

Choose a reason for hiding this comment

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

Overall looks good; a couple inline asks

"--include-manager-plugins",
metavar="PLUGINS",
default="",
help="A comma-separated list of manager plugins "
"to enable in addition to the defaults.",
)
parser.add_option(
parser.add_argument(
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the anticipated usage here? Something like --manage-sources-list-d false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, so a user can do
--manage-sources-list-d false
--manage-sources-list-d true
--manage-sources-list-d

the last one will also set it to true

landscape-client.conf Outdated Show resolved Hide resolved
landscape/lib/tests/test_config.py Show resolved Hide resolved
Copy link
Contributor

@srunde3 srunde3 left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@srunde3 srunde3 changed the title Refactor optparse to argparse. Also added manage-sources-list-d CLI option (LP:2077360) fix: add manage-sources-list-d CLI option (LP:2077360) ; refactor: optparse to argparse for CLI options Sep 6, 2024
@HJK-X HJK-X merged commit a0c696e into canonical:main Sep 6, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants