ubuntu/zsys

Dry run for system state removal inconsistent with actions performed

cmatsuoka opened this issue · 0 comments

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.