Than change here is to make cmd.{run,wait,script,etc} accept an argument
called stateful, and then it runs the commands using the stateful
approach debfined by @kjkuan
More robust logging for problems with caching RPMs and invalid paths for
local RPM files. Also changed the name of the kwarg used for specifying
RPM files to install. It was "sources", and is now "source". Every other
implementation uses "source", so I made this change to provide a
consistent user experience.
Also, in an earlier commit I referred to package files in pacman.py as
RPM files in some of the comments. Fixed this to avoid confusion.
Some tweaks to the code I added for #2291. These include:
1) Better logging when the package is not successfully cached, or a bad
path is provided for a local package file.
2) If the package file can't be cached or found locally, the calls to
list_pkgs() are skipped and an empty dict is returned. No need to run
these functions when you know there will be no change.
3) The "source" kwarg is explicitly defined in the function definition
for install().
4) More descriptive docstring for install().
5) Better regexes in _parse_pkg_meta().
Also, in testing I found that the loader throws a traceback when reading
__virtual__() in yumpkg5.py, because part of the value of the osrelease
grain is passed to the int() python built-in. In rolling release distros
like Arch the osrelease grain is empty, so a check has been added to
avoid this traceback.
This implements #2291 for zypper. list_pkgs() was also modified. Running
"zypper packages -i" only returns information on installed packages
which are in the repositories. RPMs manually installed do not show up
and thus cannot be tracked. Additionally, running "zypper packages -i"
pulls in data from the repositories to include in its output, which
results in some latency in getting results. Parsing the output from an
rpm -qa both eliminates this latency and allows non-repo packages to be
tracked.
OpenSUSE 12.2 has odd output from platform.linux_distribution(), as can
be seen below:
>>> platform.linux_distribution()
('openSUSE ', '12.2', 'x86_64')
Notice the trailing space after openSUSE. This causes the lookup in
_OS_FAMILY_MAP to fail, causing the os_family grain to be set to
'openSUSE ' instead of 'Suse'. By stripping leading and trailing
whitespace from the values returned by platform_linux_distribution(),
this issue is fixed.
- Test for mdadm in __virtual__()
- Make sure the device ie: /dev/md0 exists before running mdadm
on it. It is easier to blow up before executing a command
In the SELinux salt module, the path of the SELinux filesystem was
cached in a global variable. Instead of using that, memoize a func
that looks up the directory. Verify *all* of the commands this
module attempts to use are available before running them and having
it blow up. Finally, it moves things to using the standard with ...
try/except mantra for opening the enforce file. Should make things
cleaner
- Wrap open statements in try/except and with
- Use variables for crazy os.path.joins(). It reads easier
salt.modules.ldap: Add a small todo for ldaps:// and ldapi://