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

T5944: Fix reboot in arg #2821

Merged
merged 1 commit into from
Jan 14, 2024
Merged

T5944: Fix reboot in arg #2821

merged 1 commit into from
Jan 14, 2024

Conversation

sever-sever
Copy link
Member

Change Summary

Fix the arg for the reboot in x command
The actual arg is --reboot_in [Minutes ...]

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

reboot, power

Proposed changes

How to test

Before the fix:

vyos@r4:~$ reboot in 1
usage: powerctrl.py [-h] [--yes] (--reboot [HH:MM ...] | --reboot_in [Minutes ...] | --poweroff [Minutes|HH:MM ...] | --cancel | --check)
powerctrl.py: error: one of the arguments --reboot/-r --reboot_in/-i --poweroff/-p --cancel/-c --check is required
vyos@r4:~$ 

After the fix:

Warning: there are unsaved configuration changes!
Run 'save' command if you do not want to lose those changes after reboot/shutdown.

Broadcast message from root@debian on pts/3 (Sun 2024-01-14 22:49:19 EET):

The system will reboot at Sun 2024-01-14 22:50:19 EET!

                                                                               
Broadcast message from root@r4 (somewhere) (Sun Jan 14 22:49:19 2024):         
                                                                               
System reboot is scheduled 1
                                                                               
                                                                               
Broadcast message from root@r4 (somewhere) (Sun Jan 14 22:49:19 2024):         
                                                                               
System reboot is scheduled 1
                                                                               
Reboot is scheduled 2024-01-14 22:50:19
vyos@r4:~$ 
vyos@r4:~$ 
vyos@r4:~$ show reboot 
Reboot is scheduled 2024-01-14 22:50:19
vyos@r4:~$ 
Broadcast message from root@debian on pts/3 (Sun 2024-01-14 22:50:19 EET):

The system will reboot now!

Connection to 192.168.122.14 closed by remote host.
Connection to 192.168.122.14 closed.

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro and c-po and removed request for a team January 14, 2024 20:56
@sever-sever
Copy link
Member Author

Backport required

Copy link
Contributor

@jestabro jestabro left a comment

Choose a reason for hiding this comment

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

It is probably better to change the command line argument in the script to
--reboot-in
since argparse will correctly read this as args.reboot_in, and this is the normalized form when this script is moved to use opmode.py.

Fix the arg for the `reboot in x` command
The current arg is `--reboot_in [Minutes ...]`
The expected arg is `--reboot-in [Minutes ...]`
@sever-sever
Copy link
Member Author

It is probably better to change the command line argument in the script to --reboot-in since argparse will correctly read this as args.reboot_in, and this is the normalized form when this script is moved to use opmode.py.

@jestabro Done!

@jestabro jestabro self-requested a review January 14, 2024 22:00
@jestabro jestabro merged commit c2215e3 into vyos:current Jan 14, 2024
7 checks passed
@sever-sever
Copy link
Member Author

@Mergifyio backport sagitta

Copy link

mergify bot commented Jan 14, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants