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
merged 8 commits into from Jul 20, 2018

Conversation

Projects
None yet
4 participants
@twangboy
Contributor

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?

#48169

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?

Yes

Commits signed with GPG?

Yes

@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

@rallytime

This comment has been minimized.

Contributor

rallytime commented Jul 9, 2018

@dwoz This look good to you?

'''
salt.utils.warn_until(

This comment has been minimized.

@cachedout

cachedout Jul 11, 2018

Contributor

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

twangboy Jul 12, 2018

Contributor

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

cachedout Jul 18, 2018

Contributor

OK. Thanks for the explanation.

@cachedout

This comment has been minimized.

Contributor

cachedout commented Jul 18, 2018

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

@dwoz

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
Details
WIP ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint The lint job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details

@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