diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2012-09-11 12:14:01 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2012-09-11 12:14:01 -0500 |
commit | e2e8e3e906789a29f2847e68cc9aac9f79e5c613 (patch) | |
tree | 61ef2abc1f4e4ee30517e90b9818b6304014688c /src/lib/Bcfg2/Client | |
parent | 4967dd6ae20f24daee8ce2b599b8a39ad15b88df (diff) | |
download | bcfg2-e2e8e3e906789a29f2847e68cc9aac9f79e5c613.tar.gz bcfg2-e2e8e3e906789a29f2847e68cc9aac9f79e5c613.tar.bz2 bcfg2-e2e8e3e906789a29f2847e68cc9aac9f79e5c613.zip |
Rules: Implement status='ignore' for all service types
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Bcfg2/Client')
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/Chkconfig.py | 3 | ||||
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/RcUpdate.py | 3 | ||||
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/Systemd.py | 3 | ||||
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/launchd.py | 3 |
4 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/Chkconfig.py b/src/lib/Bcfg2/Client/Tools/Chkconfig.py index 0169b12da..ad9e58350 100644 --- a/src/lib/Bcfg2/Client/Tools/Chkconfig.py +++ b/src/lib/Bcfg2/Client/Tools/Chkconfig.py @@ -21,6 +21,9 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool): def VerifyService(self, entry, _): """Verify Service status for entry.""" + if entry.get('status') == 'ignore': + return True + try: cmd = "/sbin/chkconfig --list %s " % (entry.get('name')) raw = self.cmd.run(cmd)[1] diff --git a/src/lib/Bcfg2/Client/Tools/RcUpdate.py b/src/lib/Bcfg2/Client/Tools/RcUpdate.py index ddf9c1f2d..a53a45251 100644 --- a/src/lib/Bcfg2/Client/Tools/RcUpdate.py +++ b/src/lib/Bcfg2/Client/Tools/RcUpdate.py @@ -18,6 +18,9 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool): Assumes we run in the "default" runlevel. """ + if entry.get('status') == 'ignore': + return True + # check if service is enabled cmd = '/sbin/rc-update show default | grep %s' rc = self.cmd.run(cmd % entry.get('name'))[0] diff --git a/src/lib/Bcfg2/Client/Tools/Systemd.py b/src/lib/Bcfg2/Client/Tools/Systemd.py index a295bc608..43eca2eac 100644 --- a/src/lib/Bcfg2/Client/Tools/Systemd.py +++ b/src/lib/Bcfg2/Client/Tools/Systemd.py @@ -17,6 +17,9 @@ class Systemd(Bcfg2.Client.Tools.SvcTool): def VerifyService(self, entry, _): """Verify Service status for entry.""" + if entry.get('status') == 'ignore': + return True + cmd = "/bin/systemctl status %s.service " % (entry.get('name')) raw = ''.join(self.cmd.run(cmd)[1]) diff --git a/src/lib/Bcfg2/Client/Tools/launchd.py b/src/lib/Bcfg2/Client/Tools/launchd.py index 6f08559a2..ff0cb3788 100644 --- a/src/lib/Bcfg2/Client/Tools/launchd.py +++ b/src/lib/Bcfg2/Client/Tools/launchd.py @@ -59,6 +59,9 @@ class launchd(Bcfg2.Client.Tools.Tool): def VerifyService(self, entry, _): """Verify launchd service entry.""" + if entry.get('status') == 'ignore': + return True + try: services = self.cmd.run("/bin/launchctl list")[1] except IndexError: |