From b026f9b9a407a359b4d5615b1fb469f84b260218 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 3 Jun 2013 10:47:02 -0500 Subject: Services: Don't check status when set to 'ignore' Checking the status for services that don't support it leads to ugly output in the interactive client on some platforms. Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Client/Tools/RcUpdate.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/lib/Bcfg2/Client/Tools/RcUpdate.py') diff --git a/src/lib/Bcfg2/Client/Tools/RcUpdate.py b/src/lib/Bcfg2/Client/Tools/RcUpdate.py index d6329256e..8e9626521 100644 --- a/src/lib/Bcfg2/Client/Tools/RcUpdate.py +++ b/src/lib/Bcfg2/Client/Tools/RcUpdate.py @@ -62,27 +62,29 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool): entry.get('name')) return False - svcstatus = self.check_service(entry) - if entry.get('status') == 'on': - if svcstatus: - current_srvstatus = True - else: - current_srvstatus = False - elif entry.get('status') == 'off': - if svcstatus: - current_srvstatus = False - else: - current_srvstatus = True - else: + if entry.get('status') == 'ignore': # 'ignore' should verify - current_srvstatus = True + current_svcstatus = True + svcstatus = True + else: + svcstatus = self.check_service(entry) + if entry.get('status') == 'on': + if svcstatus: + current_svcstatus = True + else: + current_svcstatus = False + elif entry.get('status') == 'off': + if svcstatus: + current_svcstatus = False + else: + current_svcstatus = True if svcstatus: entry.set('current_status', 'on') else: entry.set('current_status', 'off') - return current_bootstatus and current_srvstatus + return current_bootstatus and current_svcstatus def InstallService(self, entry): """Install Service entry.""" -- cgit v1.2.3-1-g7c22