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 behavior of powercfg module and state #48345

merged 8 commits into from Jul 20, 2018


None yet
4 participants

twangboy commented Jun 27, 2018

What does this PR do?

Improves documentation
Uses ' instead of "
Uses minutes for the set function instead of seconds to be consistent with the documentation and the get function which returns everything in minutes.
Warn until Fluorine that the function expects seconds for settings as stated in the docs.
Adds the test=True option to the powercfg state module.

What issues does this PR fix or reference?


Previous Behavior

The value that was passed was set directly without converting to seconds. For example, if the user was trying to set a timeout of 120 minutes it was actually setting 120 seconds.

New Behavior

Now the value can be passed as minutes and it will be converted to seconds.

Tests written?


Commits signed with GPG?


@salt-jenkins salt-jenkins requested a review from saltstack/team-windows Jun 27, 2018

@twangboy twangboy requested review from rallytime and saltstack/team-windows and removed request for saltstack/team-windows Jun 27, 2018

@twangboy twangboy changed the title from Fix 48169 to Fix behavior of powercfg module and state Jun 27, 2018

twangboy added some commits Jun 25, 2018

Use minutes to set
Add ability to use test=True on the state
More documentation improvements
Add log messages
Fix unit.state.test_powercfg
Add test for test=True

@twangboy twangboy force-pushed the twangboy:fix_48169 branch from 2cd5654 to 653fbcb Jun 27, 2018


This comment has been minimized.


rallytime commented Jul 9, 2018

@dwoz This look good to you?


This comment has been minimized.


cachedout Jul 11, 2018


Why would we change to something less exact? I'm not clear on the reasoning here. Would it be better just to change the documentation instead?

This comment has been minimized.


twangboy Jul 12, 2018


Power settings in the GUI are displayed in Minutes and Hours. As a Windows admin, that's what I would expect to be setting from the CLI as well.

Since the return value is in Minutes and the documentation says minutes, I believe the original intent of the author was to set the time in Minutes.

This comment has been minimized.


cachedout Jul 18, 2018


OK. Thanks for the explanation.


This comment has been minimized.


cachedout commented Jul 18, 2018

I'm good here so long as @dwoz or @saltstack/team-windows can give it a look.


dwoz approved these changes Jul 20, 2018

@rallytime rallytime merged commit 8599168 into saltstack:2017.7 Jul 20, 2018

7 of 8 checks passed

jenkins/pr/py2-centos-7 The py2-centos-7 job has failed
WIP ready for review
continuous-integration/jenkins/pr-merge This commit looks good
jenkins/pr/docs The docs job has passed
jenkins/pr/lint The lint job has passed
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed

@twangboy twangboy deleted the twangboy:fix_48169 branch Jul 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment