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

Fix quota exec command #381

Merged
merged 4 commits into from
Sep 24, 2024
Merged

Fix quota exec command #381

merged 4 commits into from
Sep 24, 2024

Conversation

etiennedub
Copy link
Contributor

There were two issues with the previous exec command:

  1. The path was wrong
  2. The exec was never executed because of the refreshonly=true

@cmd-ntrf To avoid executing the command at every execution, I create a file with the quota state. I haven't found a better way to verify the current quota but I'm open to a better alternative.

@etiennedub
Copy link
Contributor Author

@cmd-ntrf I can use this unless instead that compare the user input with the limit currently set:
unless => "test \"$(numfmt --from=iec --to-unit=Ki $(echo ${quota} | tr '[:lower:]' '[:upper:]'))\" -eq \"$(xfs_quota -x -c 'report -N' /mnt/${volume_tag}/${volume_name} | grep root | awk '{print \$4}')\"",

But, it doesn't work in 2 scenarios:

  1. If the last Ki is uneven, xfs round it to some even value. (e.i. 233k become 236 in the report)
  2. If the user value is under 1Ki, xfs return 0 in the report (e.i. 150 become 0 in the report)

Those are definitively edges cases and I don't know if we want to support those cases. @cmd-ntrf Any preference between this command and the file creation?

@cmd-ntrf cmd-ntrf self-assigned this Sep 24, 2024
@cmd-ntrf cmd-ntrf added the bug Something isn't working label Sep 24, 2024
@cmd-ntrf cmd-ntrf merged commit c1aae73 into ComputeCanada:main Sep 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants