Commit Graph

18656 Commits

Author SHA1 Message Date
Mathieu Le Marec - Pasquet
168cb23134 Merge remote-tracking branch 's/develop' into docker 2013-10-09 19:19:11 +02:00
Thomas S Hatch
a4a8f4c535 Merge pull request #7688 from johnnoone/env_finalize
.sls data regression on template rendering
2013-10-09 09:40:19 -07:00
Thomas S Hatch
ccad2c5322 Merge pull request #7686 from evinrude/develop
Make function args available to returners in salt-call
2013-10-09 09:39:15 -07:00
Thomas S Hatch
c99645bff6 Merge pull request #7680 from joshuagoodson-uar/git-user-fix
Fix git.latest to run current branch and ls remote as correct user
2013-10-09 09:38:43 -07:00
Xavier Barbosa
569016820a ensure that printed OrderedDict can be parsed by YAML (like a regular dict) 2013-10-09 12:03:34 +02:00
Raymond Piller
bc45e726f3 OSError: [Errno 22] Invalid argument - caused by duplicate gids.
Currently, `supgroups` can return a list that has duplicate gids in it:
```python
>>> supgroups = [g.gr_gid for g in grp.getgrall() if uinfo.pw_name in g.gr_mem and g.gr_gid != uinfo.pw_gid]
>>> supgroups
[80, 29, 1, 2, 5, 9, 8, 20, 3, 4, 1, 2, 3, 4, 5, 8, 9, 20, 29, 80]
```

This cause problems in the comparison on [L80](https://github.com/saltstack/salt/blob/0.17/salt/modules/cmdmod.py#L80).  More importantly, it causes an OS error on [L82](https://github.com/saltstack/salt/blob/0.17/salt/modules/cmdmod.py#L82) when we attempt to `os.setgroups(supgroups)`.  Simply deduplicating the list before handling processing it fixes the issue.

Here's some debugging that should help you understand:
```python
>>> uinfo
pwd.struct_passwd(pw_name='root', pw_passwd='*', pw_uid=0, pw_gid=0, pw_gecos='System Administrator', pw_dir='/var/root', pw_shell='/bin/sh')
>>> [g.gr_gid for g in grp.getgrall()]
[83, 55, 87, 81, 79, 33, 67, 235, 97, 93, 32, 82, 202, 212, 72, 207, 59, 204, 220, 227, 56, 201, 25, 96, 84, 30, 211, 205, 26, 98, 100, 78, 54, 65, 74, 222, 228, 24, 209, 28, 27, 216, 76, 60, 203, 31, 92, 58, 200, 89, 75, 73, 13, 94, 210, 91, 208, 99, 95, 213, 66, 224, 221, 88, 70, 90, 80, 50, 7, 29, 401, 53, 1, 68, 12, 16, 51, 2, 61, 6, 62, 52, 69, 4294967294, 4294967295, 5, 10, 9, 8, 20, 3, 4, 45, 0, 2106269579, 4294967294, 4294967295, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 16, 20, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 45, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 200, 201, 202, 203, 204, 205, 207, 208, 209, 210, 211, 212, 213, 216, 220, 221, 222, 224, 227, 228]
>>> supgroups = [g.gr_gid for g in grp.getgrall() if uinfo.pw_name in g.gr_mem and g.gr_gid != uinfo.pw_gid]
>>> supgroups
[80, 29, 1, 2, 5, 9, 8, 20, 3, 4, 1, 2, 3, 4, 5, 8, 9, 20, 29, 80]
>>> # Notice the duplication ...
...
>>>
>>> os.getgroups()
[0, 1, 2, 3, 4, 5, 8, 9, 12, 20, 29, 61, 80]
>>> os.setgroups(supgroups)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
>>> type(supgroups)
<type 'list'>
>>> seen = set()
>>> supgroups_deduped = [ x for x in supgroups if x not in seen and not seen.add(x) ]
>>> supgroups_deduped
[80, 29, 1, 2, 5, 9, 8, 20, 3, 4]
>>> os.setgroups(supgroups_deduped)
>>> os.getgroups()
[0, 1, 2, 3, 4, 5, 8, 9, 12, 20, 29, 61, 80]
```

Solution gleened from:
http://stackoverflow.com/a/480227/615422

```sh
# /usr/local/bin/salt-minion --versions-report
           Salt: 0.16.3
         Python: 2.7.2 (default, Oct 11 2012, 20:14:37)
         Jinja2: 2.7.1
       M2Crypto: 0.21.1
 msgpack-python: 0.3.0
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 3.2.3
```
OS X 10.8.4
2013-10-08 20:34:22 -06:00
Mickey Malone
bd7b094156 Made function args available to returners 2013-10-08 21:12:37 -05:00
Joseph Hall
b8866dfb0a Merge pull request #7684 from s0undt3ch/develop
Some PEP8/Pylint fixes
2013-10-08 18:11:00 -07:00
Pedro Algarvio
d4f233144e Fix PEP-8 E302. 2013-10-09 02:07:02 +01:00
Pedro Algarvio
6b91f8b107 Fix PyLint W0102. Dangerous default value. 2013-10-09 02:05:32 +01:00
Pedro Algarvio
8db03cf73e Fix PEP-8 E302. Add UTF-8 header. 2013-10-09 02:01:51 +01:00
Pedro Algarvio
f692b9b5a2 Fix PEP-8 E302. Add UTF-8 header. 2013-10-09 01:59:45 +01:00
Joseph Hall
a1605acd80 Merge pull request #7683 from jesusaurus/feature/rabbitmq
Add more RabbitMQ functionality
2013-10-08 17:52:27 -07:00
K Jonathan Harker
6f1d185c58 Add RabbitMQ functionality
Add support for user tags and permissions to the rabbitmq_user state,
which requires adding support for set_user_tags to the rabbitmq module.

Also add a rabbitmq_plugin state, which requires adding rabbitmq-plugin
support to the rabbitmq module.
2013-10-09 00:33:27 +00:00
Pedro Algarvio
62ed9c32e6 Include the encoding header. 2013-10-09 00:05:12 +01:00
David Boucha
9c3be260c7 Merge pull request #7682 from terminalmage/windows-net-states
Add NTP state for windows
2013-10-08 14:29:07 -07:00
Erik Johnson
5a31008fd4 Update version number in docs to 0.17.0 2013-10-08 16:18:08 -05:00
Erik Johnson
af3e6efbaf Add NTP state for windows 2013-10-08 16:14:21 -05:00
Josh Goodson
7d0c0a3db7 Fix git.latest to run current branch and ls remote as correct user 2013-10-08 14:11:29 -05:00
David Boucha
496730dea5 Merge pull request #7677 from hulu/pylint
rm trailing whitespace flagged by pylint
2013-10-08 11:10:07 -07:00
Chris Rebert
167d1a8690 rm trailing whitespace flagged by pylint 2013-10-08 11:06:15 -07:00
David Boucha
a22d2cda60 Merge pull request #7676 from UtahDave/develop
Bump windows installer version number
2013-10-08 10:32:43 -07:00
David Boucha
45724660fb Bump windows installer version number 2013-10-08 11:31:19 -06:00
David Boucha
967e70582d remove hostname arguments. not needed 2013-10-08 10:09:04 -06:00
David Boucha
93879c901b Merge pull request #7674 from UtahDave/develop
Add get_computer_name function
2013-10-08 09:06:28 -07:00
David Boucha
a07e4c6e13 Add get_computer_name function 2013-10-08 10:05:34 -06:00
David Boucha
68f1d76081 Merge pull request #7673 from UtahDave/develop
Add get_computer_desc
2013-10-08 08:58:19 -07:00
David Boucha
f19a57d843 Add get_computer_desc 2013-10-08 09:57:32 -06:00
David Boucha
055054e6e3 Merge pull request #7670 from UtahDave/develop
Add fileinput to list of Windows modules to freeze
2013-10-08 07:25:30 -07:00
David Boucha
d5a7b2195c Add fileinput to list of Windows modules to freeze 2013-10-08 08:03:08 -06:00
Thomas S Hatch
fc552fccf6 Merge pull request #7667 from terminalmage/issue7304
Fix race condition in salt-key
2013-10-08 06:22:29 -07:00
Thomas S Hatch
d90491dcf1 Merge pull request #7665 from SmithSamuelM/sam_20131001
Fixed tags for progress events and preload
2013-10-08 06:16:41 -07:00
Thomas S Hatch
d9aa67a76c Merge pull request #7663 from evinrude/develop
Function arguments for smtp returner
2013-10-08 06:13:36 -07:00
Thomas S Hatch
6537a09604 Merge pull request #7631 from s0undt3ch/issues/7576-utf8-chars
Jinja needs to be "fed" Unicode data. Fixes #7576
2013-10-08 06:10:56 -07:00
Mickey Malone
06f12b0664 Merge remote-tracking branch 'upstream/develop' into develop 2013-10-08 05:54:08 -05:00
Thomas S Hatch
7f43413e96 Add the initial cloud method to the master for running
salt-cloud routines. This is just made right now to run the
authorization routines, and is not yet hooked into the salt cloud api
this is primarily because the unified async salt-cloud apis don't exist
yet
2013-10-07 23:25:03 -06:00
Thomas S Hatch
2867f81c44 Doh! self.spec_check 2013-10-07 23:25:03 -06:00
Thomas S Hatch
ad7dd8fe69 Add spec_check method to wrap arbitrary special perms routines
Once this is plugged into the master deprecate the runner_check and
wheel_check methods
2013-10-07 23:25:03 -06:00
Thomas S Hatch
f45fed72f3 plug rights into form changes for rights check 2013-10-07 23:25:03 -06:00
Thomas S Hatch
140e3759e9 change the routine to use the any_auth method 2013-10-07 23:25:03 -06:00
Thomas S Hatch
01fc24416f Add any_auth to map auth check functions correctly 2013-10-07 23:25:03 -06:00
Thomas S Hatch
53f72b129d make a ckminions object in authorize 2013-10-07 23:25:03 -06:00
Thomas S Hatch
af17a864a1 Create central auth checks for eauth and token in salt.auth 2013-10-07 23:25:03 -06:00
Thomas S Hatch
9268a344cc Add note on environment option in the minion config file 2013-10-07 23:25:03 -06:00
Erik Johnson
b1ae6e639a Changes in docs wording: 0.17 -> 0.17.0
We have no 0.17 release, the release code is 0.17.0.
2013-10-07 22:32:28 -05:00
Erik Johnson
68da3c62c7 Fix race condition in salt-key
salt-key passes on the match glob to the applicable function within
salt.key.Key. However, if the glob includes a wildcard (or the argument
passed was -A/-D/-R, which executes the add/delete/reject on '*'), then
if there is any key activity between when the confirmation prompt
appears and when 'Y' is chosen, the wildcard could match one of the new
keys, resulting in unexpected actions being taken.

This commit changes the CLI usage of salt-key so that it passes a
dictionary of matching keys to the applicable function within
salt.key.Key. API backwards compatibility is preserved, because when
these pre-compiled dictionaries of keys are passed, they are passed in a
different argument name.
2013-10-07 21:44:10 -05:00
Joseph Hall
6bb46c3d37 Merge pull request #7666 from s0undt3ch/hotfix/lint
Some PEP8 Lint fixes
2013-10-07 17:47:52 -07:00
Pedro Algarvio
e71e4b3d64 Fix PEP-8 W293, E302 2013-10-08 01:42:59 +01:00
Pedro Algarvio
31682a98ae Fix PEP-8 E302, E303, W291 2013-10-08 01:39:27 +01:00
Pedro Algarvio
30e747060d Jinja needs to be "fed" Unicode data. Fixes #7576.
Additionally, what's returned from `render_jinja_tmpl` is also a Unicode string to that the `SLS_ENCODER` can properly encode them. Encoding UTF-8 data as UTF-8 data using the `SLS_ENCODER` does not, of course, work.
2013-10-08 00:11:44 +01:00