-
Notifications
You must be signed in to change notification settings - Fork 64
Add helper script for kuberay rbac #250
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
Signed-off-by: Hemil Desai <[email protected]>
Signed-off-by: Hemil Desai <[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.
generally lgtm. but out of curiosity, would the code be more succinct if you used rich
instead of manually doing the ansi color codes?
Signed-off-by: Hemil Desai <[email protected]>
) | ||
if result.returncode == 0 and result.stdout.strip(): | ||
return result.stdout.strip() | ||
except Exception: |
Check notice
Code scanning / CodeQL
Empty except Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix the issue, the except Exception:
block should log the exception using the existing print_error
function. This ensures that any errors encountered during the execution of the subprocess.run
command are visible to the user, aiding in debugging and transparency. The fallback behavior (return "default"
) can remain unchanged, as it provides a reasonable default in case of failure.
Steps to implement the fix:
- Modify the
except Exception:
block to log the exception usingprint_error
. - Include the exception message in the log for better debugging.
- Ensure the fallback behavior (
return "default"
) remains intact.
-
Copy modified lines R63-R64
@@ -62,4 +62,4 @@ | ||
return result.stdout.strip() | ||
except Exception: | ||
pass | ||
except Exception as e: | ||
print_error(f"Failed to retrieve default namespace: {e}") | ||
|
Signed-off-by: Hemil Desai <[email protected]>
Run using
kuberay-rbac
after installing nemo-run.Start with
kuberay-rbac --help