Commit Graph

18686 Commits

Author SHA1 Message Date
Pedro Algarvio
554e313286 Merge pull request #7720 from terminalmage/windows-net-states
Add win_system state, refine win_ntp module
2013-10-09 21:26:06 -07:00
Pedro Algarvio
689178f4d6 Merge pull request #7723 from terminalmage/minion-id-caching-fix
Fix minion ID caching for minions using non-default root_dir
2013-10-09 21:04:48 -07:00
Erik Johnson
af2cf8a6c2 Fix minion ID caching for minions using non-default root_dir
Caught this in my testing since I run my development testing in
virtuialenvs and need to use the root_dir option.

This commit uses the root_dir minion option when deriving a location for
the minion ID cache file. It also cleans up some stuff that drives
pylint crazy like single-letter variable names, and generic exception
catching in try/except.
2013-10-09 22:31:54 -05:00
Erik Johnson
ab4f8ef0c1 Merge pull request #7722 from cvrebert/patch-2
pillar.django_orm: fix misspelled function name
2013-10-09 19:52:47 -07:00
Erik Johnson
86567f7083 Merge pull request #7721 from cvrebert/patch-1
ntp state: rm unused import
2013-10-09 19:51:01 -07:00
Erik Johnson
fee90d6715 Add CLI examples to fix travis breakage 2013-10-09 21:49:09 -05:00
Chris Rebert
1510596549 pillar.django_orm: fix misspelled function name 2013-10-09 19:47:45 -07:00
Chris Rebert
e0ca8c8f98 ntp state: rm unused import 2013-10-09 19:46:55 -07:00
Erik Johnson
cf1a878ed6 Add versionadded directives to new modules/states 2013-10-09 21:45:02 -05:00
Erik Johnson
3ddb416a53 Remove inapplicable exclude-members directive 2013-10-09 21:31:05 -05:00
Erik Johnson
2cb6b1c8a3 Suppress function aliases from appearing in docs 2013-10-09 21:29:05 -05:00
Erik Johnson
e9de4fde81 Alias set_computer_description to set_computer_desc 2013-10-09 21:20:19 -05:00
Erik Johnson
fc9afc708a Fix system.set_computer_desc
This would always return that the description had been changed,
resulting in the corresponding state always thinking the change had been
successful. This commit fixes that behavior.
2013-10-09 21:20:19 -05:00
Erik Johnson
46520512a6 Add win_ntp module to docs 2013-10-09 21:00:37 -05:00
Erik Johnson
10b5d8f0e1 Alias get_computer_description to get_computer_desc 2013-10-09 20:59:50 -05:00
Erik Johnson
3603669e03 Add win_system state module 2013-10-09 20:51:24 -05:00
Pedro Algarvio
6108f3b35d Merge pull request #7719 from tallus/develop
added [ ] to list larry...
2013-10-09 18:35:40 -07:00
Erik Johnson
253abc5fa1 Add new windows states to the docs 2013-10-09 20:34:21 -05:00
Paul Munday
e6b40b18c8 added [ ] to list larry... 2013-10-09 18:27:03 -07:00
Erik Johnson
0227332e34 Add get_pending_computer_name function 2013-10-09 20:02:43 -05:00
Erik Johnson
5f49ab0119 Fix windows service.status
Just looking for "PENDING" and considering the status as running is not
correct, because there is a STOP_PENDING and a START_PENDING.

Also fixed a possible race condition in stopping/starting a service,
where the service could still be in STOP_PENDING when salt attempts to
start it.
2013-10-09 17:29:34 -05:00
Thomas S Hatch
5584632b83 Merge pull request #7713 from basepi/dirtrailingslash
Strip trailing slash in file.directory state
2013-10-09 13:53:32 -07:00
Thomas S Hatch
d6c5d4a2bc Merge pull request #7678 from basepi/idcache7558
Cache minion ID after first time guessing it, Fixes #7558
2013-10-09 13:50:42 -07:00
Thomas S Hatch
4a1d1c5f18 Merge pull request #7711 from micahhausler/develop
Fixes #7710 - Adds support for system python
2013-10-09 13:50:14 -07:00
Colton Myers
2baf78cf8e Strip trailing slash in file.directory state
Adding a trailing slash to the directory name (like /etc/chef/) would
fail the state if the directory didn't exist and `makedirs` was False.
This is because it would use os.path.dirname (which would return
/etc/chef) and see that the "parent" directory didn't exist, and fail.
2013-10-09 14:49:35 -06:00
Erik Johnson
66e0f6a75a Make sure that state.sls/state.highstate cache files are not read-only
This fixes an error that occurs on Windows minions where default
permissions are inherited and files are created initially as read-only.
2013-10-09 15:10:06 -05:00
micahhausler
96a1f23a25 Fixes #7710 - Adds support for system python
Also updated documentation, and fixed some log messages
2013-10-09 16:04:52 -04:00
Erik Johnson
1eaa409aaf Fix windows service.restart
Instead of doing weird sleep/recheck stuff, just use the existing
stop/start functions.
2013-10-09 14:53:03 -05:00
Erik Johnson
2ee1dab825 Refactor new win_ntp module
Use built in service management functions to handle starting/restarting
services.
2013-10-09 14:43:44 -05:00
Pedro Algarvio
4dac2cf567 Merge pull request #7708 from terminalmage/svn-switch
Add password support to new svn.switch function
2013-10-09 11:47:24 -07:00
Erik Johnson
4fb3abfa4d Add password support to new svn.switch function 2013-10-09 13:46:30 -05:00
Pedro Algarvio
e8bb99913d Merge pull request #7702 from terminalmage/svn-switch
Add "switch" function to svn module.
2013-10-09 11:28:33 -07:00
Erik Johnson
55f25b4899 Add "switch" function to svn module.
This came via mofomikes in #salt.
2013-10-09 12:52:55 -05:00
Joseph Hall
0ce1473298 Merge pull request #7701 from ekatsah/fix-iptables-masquerading
Fix iptables masquerading
2013-10-09 10:30:06 -07:00
Joseph Hall
35a0abaa9c Merge pull request #7700 from s0undt3ch/hotfix/lint
Don't complain about PyLint W0221.
2013-10-09 10:28:20 -07:00
steak
104d739698 Fix remove environnement variables from the iptables rules generation 2013-10-09 19:25:31 +02:00
Pedro Algarvio
f90c72af15 Don't complain about PyLint W0221. 2013-10-09 18:22:40 +01:00
steak
1d71ba8378 Fix iptables module, buildrule includes table 2013-10-09 19:21:42 +02:00
Colton Myers
26ec39c8b6 Nevermind: cache in CONFIG_DIR/minion_id 2013-10-09 10:46:33 -06: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