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

Dry run for system state removal inconsistent with actions performed #221

Open
cmatsuoka opened this issue Feb 13, 2022 · 0 comments
Open

Comments

@cmatsuoka
Copy link

cmatsuoka commented Feb 13, 2022

Describe the bug
Output of zsysctl state remove -s --dry-run lists actions that are not performed in the command execution.

To Reproduce
Steps to reproduce the behavior:

  1. Choose a saved state containing system and user states:
$ zsysctl show | grep autozsys_hlarab
  - Name:       rpool/ROOT/ubuntu_u4zsnf@autozsys_hlarab
     - rpool/USERDATA/claudio_secsbv@autozsys_hlarab (2022-02-05 21:21:44)
     - rpool/USERDATA/root_secsbv@autozsys_hlarab (2022-02-05 21:21:43)
  1. Do a dry run of zsysctl remove state -s on the selected state and note the actions to be performed.
$ sudo zsysctl state remove -s -v --dry-run autozsys_hlarab
INFO Requesting to remove system state "autozsys_hlarab" 
Deleting state rpool/USERDATA/claudio_secsbv@autozsys_hlarab
Deleting state rpool/USERDATA/root_secsbv@autozsys_hlarab
Deleting state rpool/ROOT/ubuntu_u4zsnf@autozsys_hlarab
  1. Execute the command without --dry-run:
$ sudo zsysctl state remove -s -v autozsys_hlarab
INFO Requesting to remove system state "autozsys_hlarab" 
ZSys is adding automatic system snapshot to GRUB menu
  1. Show the available saved states:
$ zsysctl show | grep autozsys_hlarab
     - rpool/USERDATA/claudio_secsbv@autozsys_hlarab (2022-02-05 21:21:44)
     - rpool/USERDATA/root_secsbv@autozsys_hlarab (2022-02-05 21:21:43)

Expected behavior
Dry run output should match the actual actions performed (by either deleting user state when using -s, or by not listing user state removal actions in the dry run output and adjusting the state remove command help message).

Installed versions:

  • OS: Ubuntu Jammy Jellyfish (development branch)
  • Zsysd running version:
    zsysctl 0.5.8build1
    zsysd 0.5.8build1

Additional context
User states are correctly removed if not using -s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant