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

Change the check for the existence of cryptsetup command #8482

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

lucas-a-martins
Copy link
Contributor

Description

Currently, when starting the Agent, ACS checks if the cryptsetup command can be used by using the command's help; the output of the command is printed in the logs. However, this output is too verbose and can be confusing.

This PR addresses this issue by using the utility version to check the command, instead of help, which is much less verbose.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

  • Before changes:

grep_usage_host-1

  • After changes:

grep_version_host-1

How Has This Been Tested?

I checked the logs before and after changes. As shown in the screenshots above, the logs became more intuitive.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm
@lucas-a-martins why did you close #8480 in favour of this PR? they seem to do the same.

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d6ac91f) 30.74% compared to head (0f08216) 30.80%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8482      +/-   ##
============================================
+ Coverage     30.74%   30.80%   +0.05%     
- Complexity    33930    33990      +60     
============================================
  Files          5341     5341              
  Lines        374918   374918              
  Branches      54534    54534              
============================================
+ Hits         115286   115499     +213     
+ Misses       244374   244151     -223     
- Partials      15258    15268      +10     
Flag Coverage Δ
simulator-marvin-tests 24.72% <0.00%> (+0.09%) ⬆️
uitests 4.39% <ø> (ø)
unit-tests 16.46% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

code lgtm

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8263

@lucas-a-martins
Copy link
Contributor Author

clgtm @lucas-a-martins why did you close #8480 in favour of this PR? they seem to do the same.

@DaanHoogland thanks for your review. About the #8480, it was my first PR. I made some mistakes and didn't know how to fix them, so I thought it would be better just closing it and creating a new one, but now I know it was not a good decision. I will be more careful.

@DaanHoogland
Copy link
Contributor

clgtm @lucas-a-martins why did you close #8480 in favour of this PR? they seem to do the same.

@DaanHoogland thanks for your review. About the #8480, it was my first PR. I made some mistakes and didn't know how to fix them, so I thought it would be better just closing it and creating a new one, but now I know it was not a good decision. I will be more careful.

no problem @lucas-a-martins and no harm done. Just wondering what happened.

Copy link
Contributor

@BryanMLima BryanMLima left a comment

Choose a reason for hiding this comment

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

I manually tested this patch in a local environment, LGTM.

2024-01-12 13:59:23,198 DEBUG [utils.script.Script] (Agent-Handler-1:null) (logid:e1013b70) Executing command [cryptsetup --usage ].
2024-01-12 13:59:23,219 DEBUG [utils.script.Script] (Agent-Handler-1:null) (logid:e1013b70) Successfully executed process [12069] for command [cryptsetup --usage ].
2024-01-12 13:59:23,220 DEBUG [utils.script.Script] (Agent-Handler-1:null) (logid:e1013b70) Usage: cryptsetup [-?Vvyrq] [-?|--help] [--usage] [-V|--version]
        [-v|--verbose] [--debug] [--debug-json] [-c|--cipher=STRING]
        [-h|--hash=STRING] [-y|--verify-passphrase] [-d|--key-file=STRING]
--
2024-01-12 15:48:06,513 DEBUG [utils.script.Script] (Agent-Handler-1:null) (logid:) Executing command [cryptsetup --version ].
2024-01-12 15:48:06,525 DEBUG [utils.script.Script] (Agent-Handler-1:null) (logid:) Successfully executed process [15380] for command [cryptsetup --version ].
2024-01-12 15:48:06,527 DEBUG [utils.script.Script] (Agent-Handler-1:null) (logid:) cryptsetup 2.2.2

@DaanHoogland DaanHoogland added this to the 4.19.1.0 milestone Jan 12, 2024
@BryanMLima
Copy link
Contributor

Merging this based on four approvals and manual test.

@BryanMLima BryanMLima merged commit 39e0a8e into apache:main Jan 31, 2024
25 checks passed
Copy link

boring-cyborg bot commented Jan 31, 2024

Awesome work, congrats on your first merged pull request!

@DaanHoogland
Copy link
Contributor

Hm @BryanMLima , we were still in freeze. don't think it will be a problem though. cc @shwstppr .

@BryanMLima
Copy link
Contributor

@DaanHoogland @shwstppr, my mistake, I can revert the merge commit if it is required.

@weizhouapache
Copy link
Member

@DaanHoogland @shwstppr, my mistake, I can revert the merge commit if it is required.

No need to revert, I think
@BryanMLima

@nvazquez
Copy link
Contributor

nvazquez commented Feb 1, 2024

Hi guys, I think in case 4.19.0 RC4 makes it to be the final release this fix won't be on 4.19.1 as the milestone states, but will be present only on the future 4.20. @BryanMLima @shwstppr in case you are reverting this fix please target it to the 4.19 branch

@shwstppr
Copy link
Contributor

shwstppr commented Feb 1, 2024

Good catch @nvazquez. If we want it in 4.19.1 I guess either we need to revert and merge again in 4.19 branch once 4.19 release is done or we would need to backport the commit. Any other suggestions @BryanMLima @DaanHoogland @weizhouapache ?
If there will be another RC then all good

@weizhouapache
Copy link
Member

We can backport to 4.18, then merge forward to 4.19 and main
@shwstppr @nvazquez @DaanHoogland @JoaoJandre

weizhouapache pushed a commit that referenced this pull request Feb 1, 2024
Co-authored-by: lucas.martins.scclouds <lucas.martins@scclouds.com.br>
@DaanHoogland
Copy link
Contributor

@BryanMLima @lucas-a-martins , as @nvazquez said and hopefully it will be on 4.20 ;) but if you need it in a mainstream release before, please backport.
A revert will prevent merge forward conflicts if you do so, but is not strictly necessary. cc @shwstppr @JoaoJandre .
either way, no major harm done, just an inconvenience.

@weizhouapache
Copy link
Member

@BryanMLima @lucas-a-martins , as @nvazquez said and hopefully it will be on 4.20 ;) but if you need it in a mainstream release before, please backport.
A revert will prevent merge forward conflicts if you do so, but is not strictly necessary. cc @shwstppr @JoaoJandre .
either way, no major harm done, just an inconvenience.

@DaanHoogland
I think this is a very small fix without any risk.
I have cherry-picked the commit to 4.18 branch and pushed to the github repository. It will be in 4.18.2.0/4.19.1.0/4.20.0.0
cc @BryanMLima @lucas-a-martins @shwstppr @nvazquez

@BryanMLima
Copy link
Contributor

@DaanHoogland I think this is a very small fix without any risk. I have cherry-picked the commit to 4.18 branch and pushed to the github repository. It will be in 4.18.2.0/4.19.1.0/4.20.0.0 cc @BryanMLima @lucas-a-martins @shwstppr @nvazquez

Thanks, @weizhouapache! Sorry for any inconvenience guys, my mistake. I will pay more attention in the future.

@weizhouapache
Copy link
Member

@DaanHoogland I think this is a very small fix without any risk. I have cherry-picked the commit to 4.18 branch and pushed to the github repository. It will be in 4.18.2.0/4.19.1.0/4.20.0.0 cc @BryanMLima @lucas-a-martins @shwstppr @nvazquez

Thanks, @weizhouapache! Sorry for any inconvenience guys, my mistake. I will pay more attention in the future.

no worries @BryanMLima

dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Feb 7, 2024
Co-authored-by: lucas.martins.scclouds <lucas.martins@scclouds.com.br>
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Feb 7, 2024
Co-authored-by: lucas.martins.scclouds <lucas.martins@scclouds.com.br>
@lucas-a-martins lucas-a-martins deleted the cryptsetup-validation branch March 1, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

8 participants