* 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
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.
- 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
- 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
- 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().
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.
* 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
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.
- 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
- 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.
- 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
- 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
- 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