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

Fix parted module set CLI example #34200

Merged
merged 1 commit into from
Jun 22, 2016
Merged

Fix parted module set CLI example #34200

merged 1 commit into from
Jun 22, 2016

Conversation

ignatk
Copy link
Contributor

@ignatk ignatk commented Jun 22, 2016

What does this PR do?

Fix parted module CLI example for set function.

Previous Behavior

If you copy-paste the example given in the current documentation, the module function will fail with
Error running 'partition.set': Invalid state passed to partition.set.
This is probably because the on parameter gets parsed by YAML renderer and transform to True in code.

New Behavior

With quotes executes normally. Also, a warning was added as different quoting may be required to run this module from state/pillar sls files.

Tests written?

Not required.

@rallytime
Copy link
Contributor

Good catch @secumod! There is a small lint error. Can you fix that up, and then we'll get this merged in. :)

@bobrik
Copy link
Contributor

bobrik commented Jun 22, 2016

$ grep ' on$' -r salt | grep ': *salt'
salt/modules/bluez.py:        salt '*' bluetooth.power hci0 on
salt/modules/parted.py:        salt '*' partition.set /dev/sda 1 boot on
$ grep ' off$' -r salt | grep ':\s\+salt'
salt/modules/bluez.py:        salt '*' bluetooth.power hci0 off
salt/modules/mac_power.py:        salt '*' power.set_computer_sleep off
salt/modules/mac_power.py:        salt '*' power.set_display_sleep off
salt/modules/mac_power.py:        salt '*' power.set_harddisk_sleep off
salt/modules/selinux.py:        salt '*' selinux.setsebool virt_use_usb off

Not sure about other special words in yaml, maybe there are more of them.

@cachedout
Copy link
Contributor

Just started reviewing :)

:octocat: Sent from GH.

cachedout pushed a commit to cachedout/salt that referenced this pull request Jun 22, 2016
@cachedout cachedout mentioned this pull request Jun 22, 2016
@cachedout cachedout merged commit 2cd0433 into saltstack:2016.3 Jun 22, 2016
@ignatk
Copy link
Contributor Author

ignatk commented Jun 22, 2016

@cachedout thanks for fixing the lint

gitebra pushed a commit to gitebra/salt that referenced this pull request Jun 23, 2016
* upstream/develop: (37 commits)
  Use ipaddress to validate ipv4/ipv6 (saltstack#33956)
  Updated winrepo_test (saltstack#34227)
  Whitespace fix for saltstack#34235 (saltstack#34250)
  message_format was not set in the correct function (saltstack#34235)
  Typo in dockerio doc (saltstack#34244)
  Fixup test failure
  Pass through update_holds to pkg.install
  fix regression from saltstack#33681 which causes pulling a list of s3 objects via s3.query to fail (saltstack#34208)
  fix regression in s3.query from saltstack#33599 that causes pulling a file list from s3 to fail (saltstack#34207)
  utils/parsers.py: disable minion multiprocessing logging if only running one process
  Fix a pair of gitfs bugs (saltstack#34218)
  rsync state: Removed source existance check saltstack#25251
  Linted saltstack#34200
  Allow specifying memory, cpu and vcpu as kwargs for OpenNebula (saltstack#34203)
  Fixes saltstack#34181 no more newlines in long yaml encodes
  Clarify pkg.list_repo_pkgs docstring for held packages (saltstack#34188)
  Update saltutil.wheel docs to specify remote vs local minion behavior
  fix regression in s3.query from saltstack#33682
  Change target for dockerng assuming default status to Nitrogen release (saltstack#34206)
  Correct the docstrings formatting in pkgbuild modules and state (saltstack#34194)
  ...
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

Successfully merging this pull request may close these issues.

None yet

4 participants