Commit Graph

7426 Commits

Author SHA1 Message Date
Pedro Algarvio
6448dd87da Some fixes on the git state tests.
* Always remove the repository directory.
* When testing recursive with git 1.7.9.5, we cannot test for a directory because it's a plain file with the contents:
  gitdir: /tmp/salt-tests-tmpdir/salt_repo/.git/modules/vendor/modules/js/receiptverifier
2012-11-04 09:58:05 +00:00
Thomas S Hatch
26cc7ff467 Merge pull request #2437 from SEJeff/random-module-updates
Random module updates v2
2012-11-03 23:04:02 -07:00
Jeff Schroeder
5c4309621c salt.modules.nginx: some trivial cleanups
- Always use the full path to the nginx binary via: which('nginx')
    - Use the new memoize utils function to cache the full path to nginx
2012-11-03 22:32:09 -07:00
Jeff Schroeder
025dcdaa6a Add salt.utils.memoize() to cache return output
I looked at several ways to do this and played with it a bit. This
was the shortest and most concise. It seems like there might be some
other places to do it, so I added it as a utility function.
2012-11-03 22:18:57 -07:00
Jeff Schroeder
4c26f60049 salt.modules.freebsdjail: make this module a bit more resilient
- Use with statement for some opens to not have issues wtih
      dangling file handles kept open by the python interpreter
    - Switch checks from os.path.isfile() and then blindly opening
      to os.access(fname, os.R_OK), which will return False nicely
      if permission is denied *or* the file doesn't exist, preventing
      unlikely yet potential unhandled tracebacks
2012-11-03 21:57:17 -07:00
Jeff Schroeder
570d6b1db9 cmd.run strips output by default
No point in duplicating things more than necessary. Found with:
    git grep -E "__salt__\['cmd\.ru.*'\]\(.*\)\.strip\(\)"
2012-11-03 21:36:51 -07:00
Jeff Schroeder
2bc78460db Automated cleanup converting str.split('\n') --> str.splitlines()
Performed with this command from the top-level source tree:
	find -name '*.py' -type f | xargs sed -r -i "s/\.split\('\\\n'\)/.splitlines()/g"
2012-11-03 21:25:11 -07:00
Jeff Schroeder
6e3515ac44 salt.modules.status: general cleanups
- s/\.split('\n')/.splitlines()/g
    - Add __virtual__() and TODOs for proper Windows and BSD support
    - Remove .strip() from cmd.run invocations as that happens already
    - Use some builtin functions like str.isdigit instead of try/except
2012-11-03 21:06:27 -07:00
Jeff Schroeder
9d6ffec115 Simple but substantial grains refactor
- Some of the Provides comments were wrong for windows and bsd
    - Use with statment for some of the open calls
    - Clean up some code to be a bit easier to read and maintain
    - Clean up a bunch of pylint 'errors' and unused variables
    - cmd.run has defaulted to stripping output since I made it
      so there is no point in all of these grains to re-strip().
2012-11-03 20:51:31 -07:00
Jeff Schroeder
ab63cc3c2f salt.modules.grub: Remove code and don't change functionality
Also add a few RedHat-ish distros to the list for grub.conf that
weren't already. CloudLinux and OVS and the other variant of Oracle
Linux come to mind.
2012-11-03 19:51:02 -07:00
Thomas S Hatch
181b65ad13 Merge pull request #2432 from ffa/git_bug_fixes
bug fixes for conformity because cult code is good code
2012-11-03 08:18:39 -07:00
Thomas S Hatch
ea94c6d3c2 Merge pull request #2434 from ffa/ruby_remove_accidental_code
remove illogical broken code
2012-11-03 08:14:25 -07:00
ffa
d417b2689f remove illogical broken code
maybe an artifact from testing?
2012-11-03 01:29:26 -07:00
ffa
a12d859642 bug fixes for conformity because cult code is good code
* don't overwrite or delete when the force option is not true

  * when the user `runas` doesn't have permission to create a directory in the
    parent directory of `target` or `name`, the directory may be created in
    preparation of git. So, don't remove the empty directory before cloning.

  * the force option still removes the directory even if it is empty

* ensure submodules are initiated recursively everywhere for consistency

* catch all module calls for consistency

* tests to test
2012-11-03 00:30:31 -07:00
Thomas S Hatch
675b3cda9a verify that the data passed to test.sleep is an int 2012-11-02 23:55:16 -06:00
Thomas S Hatch
9caf102f90 Add test.sleep function 2012-11-02 23:44:49 -06:00
Thomas S Hatch
ec6afefed3 Repair break in client_acl introduced with the acs 2012-11-02 23:28:27 -06:00
Thomas S Hatch
299f9d26e6 Allow the user that the master is running as to command the master
This fixes an issue where the master could not be started as the
literal user. This fixes running tests as non-root
2012-11-02 22:31:10 -06:00
Thomas S Hatch
7205c55e8c some minor style fixes 2012-11-02 21:57:34 -06:00
Thomas S Hatch
3cf317a919 Default sub_timeout to 0 2012-11-02 21:47:25 -06:00
Thomas S Hatch
9b644546a7 Merge pull request #2429 from techhat/mysql-to-dict
Add function to convert mysql-style output to a python dict
2012-11-02 08:36:09 -07:00
Joseph Hall
7952a8b17b Add function to convert mysql-style output to a python dict 2012-11-02 09:28:20 -06:00
Thomas S Hatch
4731fda3f5 Fix some quotes 2012-11-01 22:12:38 -06:00
Thomas S Hatch
cacf179f34 Merge pull request #2427 from SEJeff/random-module-updates
Random module updates
2012-11-01 21:07:28 -07:00
Jeff Schroeder
2a8b4de0f4 Tom broke the minion via this change point and laugh!
Just kidding (sort of). __salt__() is not available in __virtual__()
so this reverts 1/2 of the previous commit for this module fixing it
so the minion will happily start.
2012-11-01 20:54:55 -07:00
Jeff Schroeder
2dd205bbda salt.modules.daemontools: added features and removed code
- Mostly pylint griping about no spaces after commas
    - Removed more code than added by 1 line and still managed to
      add an outputter for 1 of the functions
2012-11-01 20:50:39 -07:00
Jeff Schroeder
8e224c8f28 salt.modules.ldapmod: very minor cleanups
- Make a dict more readable
    - 'foo %s' % (bar, bunny) --> 'foo {0}'.format(bar, bunny)
2012-11-01 20:50:39 -07:00
Jeff Schroeder
c9c3eed179 salt.modules.ldap: rename to ldapmod to not break python-ldap 2012-11-01 20:50:39 -07:00
Jeff Schroeder
9b710347f9 salt.modules.augeas_cfg: awesome cleanups for an awesome module
- Add outputters for some of the functions
    - Remove duplicate 'from augeas import Augeas' statements
    - Make pylint happy: x --> _match
2012-11-01 20:50:39 -07:00
Jeff Schroeder
1f77454887 salt.modules.at: moar cleanups
- Overriding builtin functions (bin()) with variables is a
      bad idea that will just eventually bite you. s/bin/&ary/g
    - Change *opts --> *args and *pargs --> *args like the rest
      of the python world. Consistency is a beautiful thing folks
    - None is a singleton, so pep8 says to use the is operator
    - Make __virtual__() return False if at isn't found in $PATH
    - Switch from __salt__['cmd.which'] to just importing and
      using the function directly. Slightly less overhead
    - Change two if statements to if/elsif

This module still needs a bit more love.
2012-11-01 20:50:39 -07:00
Jeff Schroeder
8762ffeefe salt.utils.archive: some general cleanups
- Use splitlines() instead of split('\n')
    - Add __virtual__() and some TODO entries
2012-11-01 20:50:39 -07:00
Jeff Schroeder
328aeb751a salt.modules.at: minor cleanups
- foo.split('\n') --> foo.splitlines()
    - Add outputter for at, atq, and atrm funcs
    - Use the os_family grain for all RedHat hosts

Please test this out folks, I'm not a huge at user
2012-11-01 20:50:39 -07:00
Jeff Schroeder
043d7204ab salt.modules.apt: minor cleanups
- Use the os_family grain in __virtual__()
    - Add outputters for some of the functions and add comments
    - Change double to single quotes for code style consistency
2012-11-01 20:50:39 -07:00
Jeff Schroeder
45253c895d salt.modules.apache: some minor updates
- Added outputters for the functions that made sense
    - Switched to '{0} -X'.format(foobar()) format strings
    - Replaced line.strip(' -D '), as this is almost certainly
      not what we want to do. Use a regex to properly replace it
2012-11-01 20:50:39 -07:00
Jeff Schroeder
221dd074b4 salt.modules.aliases: use outputters for each function
Also change which() to _which to prevent the doc system from using it
2012-11-01 20:50:39 -07:00
Jeff Schroeder
ecb3139317 salt.modules.aliases: search $PATH for newaliases 2012-11-01 20:50:39 -07:00
Thomas S Hatch
41d3060cd8 Merge pull request #2426 from Talksum/proc_perms
add proc subdir of cachedir to the verify_env dir list
2012-11-01 18:43:49 -07:00
Mike Chesnut
e238b43194 add proc subdir of cachedir to the verify_env dir list
this fixes an issue for me when I'm running minions as non-root users;
without it I get a permission denied error when the minion starts up
2012-11-01 18:40:19 -07:00
Thomas S Hatch
0d3082c4e9 clean up backup mode lookup and add root pillar lookups for options 2012-11-01 17:44:06 -06:00
Thomas S Hatch
464f3a2867 move mysql module to use new config.option function 2012-11-01 16:59:54 -06:00
Thomas S Hatch
ae5e5daca2 Add config.option changes for alias.py 2012-11-01 16:52:42 -06:00
Thomas S Hatch
22089a5110 config.option for gem module 2012-11-01 16:48:13 -06:00
Thomas S Hatch
ab9f8aba5e config.option for hosts ex module 2012-11-01 16:44:43 -06:00
Thomas S Hatch
f3076cd316 update ldap module to use config.option 2012-11-01 16:39:16 -06:00
Thomas S Hatch
1b38369a36 Add config.option to the mongo module 2012-11-01 16:29:19 -06:00
Thomas S Hatch
351b5b6795 Add config.option calls to postgres 2012-11-01 16:25:50 -06:00
Thomas S Hatch
3a7c134bcb Add config.option components to poudriere ex module 2012-11-01 16:22:35 -06:00
Thomas S Hatch
eb0733e497 update solr module to use config.option 2012-11-01 16:17:43 -06:00
Thomas S Hatch
c042e3097e use new pillar components in status.custom 2012-11-01 16:03:58 -06:00
Thomas S Hatch
3abf7ff47e Add dot_vals function to config.py 2012-11-01 15:55:07 -06:00