diff --git a/compass/actions/health_check/check_dhcp.py b/compass/actions/health_check/check_dhcp.py index 2ad789de..2b948e60 100644 --- a/compass/actions/health_check/check_dhcp.py +++ b/compass/actions/health_check/check_dhcp.py @@ -39,7 +39,8 @@ class DhcpCheck(base.BaseCheck): cobbler_settings = self.remote.get_settings() if cobbler_settings['manage_dhcp'] == 0: self.messages.append( - "[DHCP]Info: DHCP service is not managed by Compass") + "[%s]Info: DHCP service is not managed by Compass" + % self.NAME) return (self.code, self.messages) self.check_cobbler_dhcp_template() print "[Done]" diff --git a/compass/actions/health_check/check_hds.py b/compass/actions/health_check/check_hds.py index d2dbe7a2..c31273b3 100644 --- a/compass/actions/health_check/check_hds.py +++ b/compass/actions/health_check/check_hds.py @@ -19,16 +19,18 @@ class HdsCheck(base.BaseCheck): try: pkg_module = __import__(pkg_type) except: - self.messages.append("[HDS]Error: No module named %s, " - "please install it first." % pkg_module) + self.messages.append("[%s]Error: No module named %s, " + "please install it first." + % (self.NAME, pkg_module)) method_name = 'self.check_' + pkg_type + '_snmp(pkg_module)' eval(method_name) print "[Done]" self.check_snmp_mibs() print "[Done]" if self.code == 1: - self.messages.append("[HDS]Info: hds health check has complated. " - "No problems found, all systems go.") + self.messages.append("[%s]Info: hds health check has complated. " + "No problems found, all systems go." + % self.NAME) return (self.code, self.messages) def check_yum_snmp(self, pkg_module): @@ -44,8 +46,8 @@ class HdsCheck(base.BaseCheck): uninstalled = [] for package in ['net-snmp-utils', 'net-snmp', 'net-snmp-python']: if not yum_base.rpmdb.searchNevra(name=package): - self.messages.append("[HDS]Error: %s package is required " - "for HDS" % package) + self.messages.append("[%s]Error: %s package is required " + "for HDS" % (self.NAME, package)) uninstalled.append(package) if len(uninstalled) != 0: self._set_status(0, "[%s]Info: Uninstalled packages: %s" diff --git a/compass/actions/health_check/check_misc.py b/compass/actions/health_check/check_misc.py index 01e622ec..64565c73 100644 --- a/compass/actions/health_check/check_misc.py +++ b/compass/actions/health_check/check_misc.py @@ -162,8 +162,8 @@ class MiscCheck(base.BaseCheck): if health_check_utils.check_chkconfig(serv) is True: self._set_status( 0, - "[Miscellaenous Check]Error: %s is not disabled" - % serv) + "[%s]Error: %s is not disabled" + % (self.NAME, serv)) serv_to_disable.append(serv) if len(serv_to_disable) != 0: self._set_status( diff --git a/compass/actions/health_check/check_os_installer.py b/compass/actions/health_check/check_os_installer.py index dac58423..02c4d985 100644 --- a/compass/actions/health_check/check_os_installer.py +++ b/compass/actions/health_check/check_os_installer.py @@ -28,12 +28,13 @@ class OsInstallerCheck(base.BaseCheck): except: self.code = 0 self.messages.append( - "[OS Installer]Error: Cannot login to Cobbler with " - "the tokens provided in the config file") + "[%s]Error: Cannot login to Cobbler with " + "the tokens provided in the config file" + % self.NAME) self.messages.append( - "[OS Installer]Error: Failed to connect to Cobbler " + "[%s]Error: Failed to connect to Cobbler " "API, please check if /etc/cobbler/setting " - "is properly configured") + "is properly configured" % self.NAME) return (self.code, self.messages) check_result = self.remote.check(self.token) @@ -44,7 +45,7 @@ class OsInstallerCheck(base.BaseCheck): if len(check_result) != 0: self.code = 0 for error_msg in check_result: - self.messages.append("[OS Installer]Error: " + error_msg) + self.messages.append("[%s]Error: " % self.NAME + error_msg) if len(self.remote.get_distros()) == 0: self._set_status(0, @@ -111,7 +112,7 @@ class OsInstallerCheck(base.BaseCheck): if self.code == 1: self.messages.append( - "[OS Installer]Info: OS Installer health check " - "has completed. No problems found, all systems go.") + "[%s]Info: OS Installer health check has completed." + " No problems found, all systems go." % self.NAME) return (self.code, self.messages)