-
Notifications
You must be signed in to change notification settings - Fork 383
T7626: op-mode: fix several op-mode command for syntax #4603
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
Conversation
❌ |
I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
I have read the CLA Document and I hereby sign the CLA |
bec6146
to
4d2183a
Compare
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.
We used shell scripts for other commands 1d32420
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.
Something certainly needs to be done about those commands. I'm not exactly against merging this PR, but the deal is that it already says "fix update container
" but in reality fixes three unrelated commands, and there are more commands with embedded shell scripts still left, mainly in show log
.
@tjjh89017 Do you want to take up fixing the rest? It's ok if not, then I can rename this PR to something generic and approve it.
Hi @dmbaturin |
@tjjh89017 I think it's an acceptable stop-gap measure and it's good that we can identify all commands like that by grepping for I think the long-term plan should be to provide a function in the standardized op mode API for this, and a corresponding tag in the op mode schema — or perhaps make it implicit in the script if that function exists. I need to think about it and put those thoughts in a Phorge task, but we still need to fix the immediate issue, since converting all those commands to standardized op mode will take quite a bit longer. |
@dmbaturin |
@tjjh89017 could you rebase the PR? |
update container image <container name> show environment sensors show log certbot Signed-off-by: Date Huang <[email protected]>
I rebased it. |
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.
Pull Request Overview
This PR fixes syntax errors in op-mode commands by properly wrapping shell conditionals in bash -c blocks. The changes address shell syntax issues that were causing errors like "syntax error near unexpected token 'then'" when executing these commands.
- Wraps if-then-else statements in bash -c blocks to ensure proper shell execution
- Adds proper quoting for variables and string literals within the bash commands
- Fixes three op-mode commands: show log certbot, show environment sensors, and update container image
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
op-mode-definitions/show-log.xml.in | Wraps certbot log command in bash -c for proper if-then-else execution |
op-mode-definitions/show-environment.xml.in | Wraps sensors command in bash -c and fixes path variable quoting |
op-mode-definitions/container.xml.in | Wraps container update command in bash -c and adds proper variable quoting |
Co-authored-by: Copilot <[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.
Let's merge it as is and then we can fix the remaining commands ourselves. Thanks, @tjjh89017 !
thank you |
CI integration 👍 passed! Details
|
Change summary
Types of changes
Related Task(s)
https://vyos.dev/T7626
Related PR(s)
How to test / Smoketest result
And without error like
Checklist: