-
Notifications
You must be signed in to change notification settings - Fork 15
[WIP] Refactor command.py #30
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
base: main
Are you sure you want to change the base?
Conversation
| from . import containers | ||
| from . import containerutils | ||
| from . import groups | ||
| from . import users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the removal of relative imports here? I was going to suggest adding them in cli_functions.py and then see the opposite here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we were having a weird import error with them - removing it resolved them, and I did a bit of research as to why I was seeing the error but couldn't suss it out.
Down the line once this is closer to merging we can add them back in and work out why they were causing an issue (or maybe the issue won't be reproducible.)
| parser.add_argument("-u", "--username", type=str, action="store") | ||
| parser.add_argument("-p", "--password", type=str, action="store") | ||
| parser.add_argument("-u", "--username", default="admin", type=str, action="store") | ||
| parser.add_argument("-p", "--password", default="admin", type=str, action="store") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these defaults just for testing and to be removed before merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's still up for debate - at the moment I think gkit gets used against the dev environment the most, but maybe no default makes more sense, in which case they become required arguments.
| user_url = f"_ui/v1/users/?username={username}" | ||
| user_resp = client.get(user_url) | ||
| return user_resp["data"][0] | ||
| if user_resp["data"] is not []: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not user_resp["data"]:
No description provided.