-
Notifications
You must be signed in to change notification settings - Fork 39
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 system command processing during logging in user tools #633
Conversation
Signed-off-by: Partho Sarthi <[email protected]>
Signed-off-by: Partho Sarthi <[email protected]>
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.
LGTM. Thanks @parthosa !
if isinstance(cmd, list): | ||
cmd_list = cmd | ||
else: | ||
cmd_list = cmd.split(' ') |
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.
not sure if this is more concise, nit: cmd_list = cmd if isinstance(cmd, list) else cmd.split(' ')
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.
Refactored to make it more concise.
Signed-off-by: Partho Sarthi <[email protected]>
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.
Thanks @parthosa!
Fixes #632. The
cmd
argument inrun_sys_cmd()
in user tools can be of either list or string type. The inner methodprocess_credentials_option()
expectscmd
to be of list type and processes each item. However, ifcmd
is of string type, thenprocess_credentials_option()
will process each character instead.Changes:
cmd
argument and split it into a list if it is of string type.cmd
argument inrun_sys_cmd()
.Testing:
The cmd described in the issue has been tested.
Cmd:
spark_rapids_user_tools dataproc diagnostic psarthi-dataproc-test -v
Previous output:
Current output: