Commit Graph

2081 Commits

Author SHA1 Message Date
Corey Quinn
e5d8796f61 Fixed up install and manpages 2011-12-26 13:20:08 -08:00
Corey Quinn
7a57caf981 Missed a comma 2011-12-26 10:55:16 -08:00
Corey Quinn
fee35c422a Initial changes to try to get sane separate packages for master and minion 2011-12-24 21:01:58 -08:00
Seth House
a3b66b1ddf Merge pull request #386 from whiteinge/doc-wheezy
Fixed incorrect docs about the python-zmq package; thanks akaihola!
2011-12-22 10:35:02 -08:00
Seth House
76610ee2d6 Fixed incorrect docs about the python-zmq package; thanks akaihola! 2011-12-22 11:26:26 -07:00
Nathaniel Whiteinge
c3cad24747 Merge pull request #382 from whiteinge/doc-salt.highstate
Fixed a bone-headed typo; thanks for the report, zhengliu
2011-12-21 08:20:31 -08:00
Seth House
e5ffaf193d Fixed a bone-headed typo; thanks for the report, Zheng Liu! 2011-12-21 08:15:35 -07:00
Jeff Schroeder
e0195ac076 Add a TODO for tomorrow for the new grain __salt__['cmd.run'] code 2011-12-20 23:44:43 -08:00
Jeff Schroeder
24db5ea204 Merge branch 'develop' of https://github.com/cedwards/salt into christer
Conflicts:
	salt/modules/cmd.py

Manually fix up the conflicts
2011-12-20 23:34:48 -08:00
Jeff Schroeder
8dcb2bbb7f Make __salt__['cmd.run'] available for grains to use 2011-12-20 23:30:13 -08:00
Christer Edwards
6c9d278820 all of these files had typos. :set spell is your friend :) 2011-12-20 23:26:16 -07:00
Jeff Schroeder
7d693ad7b5 Remove a dead function 2011-12-20 22:09:15 -08:00
Jeff Schroeder
0a0ac3bb96 Refactor all of the different cmd.run* subprocess calls into 1
All of the various subprocess.Popen invocations are now merged into one mega
function to  call  subprocess.Popen and return the results happily  for  you

root@desktopmonster:~# salt '*' cmd.run 'su - jeff -c "cat /etc/shadow"' --text-out
desktopmonster: cat: /etc/shadow: Permission denied
root@desktopmonster:~# salt '*' cmd.run 'whoami' --text-out
desktopmonster: root

root@desktopmonster:~# salt '*' cmd.run_stdout 'su - jeff -c "cat /etc/shadow"' --text-out
root@desktopmonster:~# salt '*' cmd.run_stdout 'whoami' --text-out
desktopmonster: root

root@desktopmonster:~# salt '*' cmd.run_stderr 'su - jeff -c "cat /etc/shadow"' --text-out
desktopmonster: cat: /etc/shadow: Permission denied
root@desktopmonster:~# salt '*' cmd.run_stderr 'whoami' --text-out

root@desktopmonster:~# salt '*' cmd.run_all 'su - jeff -c "cat /etc/shadow"' --text-out
key: {'pid': 573, 'retcode': 1, 'stderr': 'cat: /etc/shadow: Permission denied\n', 'stdout': ''}
root@desktopmonster:~# salt '*' cmd.run_all 'whoami' --text-out
desktopmonster: {'pid': 601, 'retcode': 0, 'stderr': '', 'stdout': 'root\n'}

root@desktopmonster:~# salt '*' cmd.retcode 'su - jeff -c "cat /etc/shadow"'
{'desktopmonster': 1}
root@desktopmonster:~# salt '*' cmd.retcode 'whoami'
{'desktopmonster': 0}

root@desktopmonster:~# salt '*' cmd.exec_code python 'print "HI"'
{'desktopmonster': 'HI\n'}
2011-12-20 22:09:11 -08:00
Jeff Schroeder
355610bf56 Merge pull request #380 from iamb/sock-dir-missing-root-dir
prepend root_dir to sock_dir fixes #379
2011-12-20 20:38:48 -08:00
Christer Edwards
55bfa26579 standardized on single-quotes throughout the file 2011-12-20 21:30:07 -07:00
Christer Edwards
335942ffb7 updated grains/core.py to use cmd.run instead of subprocess 2011-12-20 21:21:43 -07:00
Brad Barden
6b6b0f78b5 prepend root_dir to sock_dir fixes #379 2011-12-20 22:19:42 -06:00
Jeff Schroeder
ef5a75f03c Merge pull request #377 from cedwards/develop
updated salt-git PKGBUILD to use proper upstream URL
2011-12-20 18:46:09 -08:00
Christer Edwards
aa957b993e updated salt-git PKGBUILD to use proper upstream URL 2011-12-20 19:34:07 -07:00
Jeff Schroeder
1b8ec74efd Fix an indentation error added accidentally 2011-12-20 18:04:42 -08:00
Jeff Schroeder
6e175ac182 Merge pull request #374 from SEJeff/more-exceptions
More exceptions, part Deux
2011-12-20 17:49:34 -08:00
Jeff Schroeder
1d60a7cb3c Address some stylistic comments from whiteinge
- In client.py, the if conditional was indented 2 spaces
    - In cli/__init__.py, use SaltInvocationError as exc style
2011-12-20 17:51:41 -08:00
Jeff Schroeder
8e474978c4 Merge pull request #375 from whiteinge/salt-exception
Moved all Salt exceptions to inherit from a common exception class
2011-12-20 06:06:55 -08:00
Seth House
e56de8aacd Moved all Salt exceptions to inherit from a common exception class 2011-12-20 00:13:15 -07:00
Jeff Schroeder
390ff9f7ba Properly handle nodegroups that don't exist
The new exceptions module's SaltInvocationError was written specifically
to pretty-print errors whenever a nodegroup is references  that  doesn't
exist in the master's configuration file.

===== BEFORE =====
root@desktopmonster:~# salt -N group3 test.version
Traceback (most recent call last):
  File "/home/jeff/git/salt/scripts/salt", line 17, in <module>
    main()
  File "/home/jeff/git/salt/scripts/salt", line 14, in main
    client.run()
  File "/home/jeff/git/salt/salt/cli/__init__.py", line 248, in run
    full_ret = local.cmd_full_return(*args)
  File "/home/jeff/git/salt/salt/client.py", line 170, in cmd_full_return
    timeout=timeout)
  File "/home/jeff/git/salt/salt/client.py", line 321, in pub
    tgt = self.opts['nodegroups'][tgt]
KeyError: 'group3'

===== AFTER =====
root@desktopmonster:~# salt -N group3 test.version
Node group 'group3' not available in /etc/salt/master
2011-12-19 23:05:56 -08:00
Jeff Schroeder
ca7df54e12 Raise a SaltInvocationError when a bogus nodegroup is specified 2011-12-19 23:05:52 -08:00
Jeff Schroeder
f61f116e73 Merge branch 'nodegroups' of https://github.com/schelcj/salt into develop
Conflicts:
	salt/config.py

Manually fix the merge commits after the msgpack branch. Fixes #363
2011-12-19 22:56:16 -08:00
Jeff Schroeder
689bcdc637 Merge pull request #373 from SEJeff/more-exceptions
More exceptions and pony power
2011-12-19 22:48:52 -08:00
Jeff Schroeder
5190c817f4 Add exceptions.SaltInvocationError
The idea of this is for fixing the nodegroups patch series when an
invalid nodegroup name is specified on the commandline and  return
a user friendly error message instead of blowing up angrily.
2011-12-19 22:10:18 -08:00
Jeff Schroeder
a98db62b02 How embarassing, this module wasn't in the salt package 2011-12-19 22:08:02 -08:00
Jeff Schroeder
7915a09523 Add exceptions.CommandNotFoundError
This can be later used in modules and in the grains to gracefully
show when commands aren't available.
2011-12-19 22:08:02 -08:00
Jeff Schroeder
1f06a900a7 Add Jeff to AUTHORS 2011-12-19 22:08:02 -08:00
Jeff Schroeder
5f8c942cc1 Split out all exceptions into their own module
This also makes it easy to find all of the exceptions
salt uses and gives a rough idea of what they are for
2011-12-19 22:08:02 -08:00
Jeff Schroeder
1d78989462 Merge pull request #372 from SEJeff/misc-cleanups
Cleanups of the cmd module
2011-12-19 22:03:00 -08:00
Jeff Schroeder
8b6933689c Merge pull request #371 from cedwards/develop
added examples to all docstrings in ps module
2011-12-19 21:57:23 -08:00
Jeff Schroeder
26a69fd4dc Cleanups of the cmd module
- Changed the doc strings from cmd | grep | awk to using cmd | awk
    - Changed has_exec to use salt.utils.which
    - Add cmd.which
2011-12-19 21:56:50 -08:00
Christer Edwards
7c498dd75b added examples to all docstrings 2011-12-19 22:29:26 -07:00
Christer Edwards
45ed62db93 use more human-readable function names in ps function 2011-12-19 22:10:46 -07:00
Jeff Schroeder
5ed6a3ccc4 Merge pull request #370 from cedwards/develop
changed uppercase functions to lowercase in ps module
2011-12-19 20:44:08 -08:00
Christer Edwards
b4e1e529a0 fixed embarrasing uppercase character in ps function 2011-12-19 21:39:32 -07:00
Christer Edwards
1c33863c88 changed uppercase functions to lowercase in ps module 2011-12-19 21:31:17 -07:00
Jeff Schroeder
3db51e31ee Merge pull request #369 from iamb/file-open-race
Fix a permissions race condition with the private keys.
2011-12-19 20:10:42 -08:00
Brad Barden
236cbbfd75 Merge branch 'develop' into file-open-race 2011-12-19 18:40:27 -06:00
Jeff Schroeder
f7c5513c9a Merge pull request #368 from KB1JWQ/logfix
Logfix
2011-12-18 21:15:29 -08:00
Corey Quinn
dd51ab4526 Make the daemons log to WARN on start
It makes better sense to log a message to the default logging level of
"warn" when starting the service; otherwise this will be discarded by
default.
2011-12-18 20:50:29 -08:00
Jeff Schroeder
cbf579ba9d Merge pull request #367 from mb0/modules-doc-fixes
fix doc strings of some modules
2011-12-18 20:44:21 -08:00
Brad Barden
3069794f2e Typo fix 2011-12-18 22:09:06 -06:00
Brad Barden
02a194746f Prevent race on private file creation
Set umask to 077 during operations that create private files to prevent a race
against chmod which comes after.
2011-12-18 20:59:53 -06:00
Corey Quinn
8702dd5a6f Change log start to a WARN rather than an INFO 2011-12-19 00:37:06 +00:00
Martin Schnabel
95d05543c4 fix doc strings of some modules 2011-12-18 22:34:24 +01:00