def process(self): (opts, args) = getopts() chkopts(opts) self.up_progress(10) config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() service = config.findby1service(opts.name) self.up_progress(10) sysv = SysVInit_RH(service['system_name'], service['system_command']) if sysv.restart(force=False) is False: raise KssCommandException(str(sysv.error_msg)) self.up_progress(50) self.logger.info('Restarted service. - service=%s' % (opts.name)) print >>sys.stdout, _('Restarted service. - service=%s') % (opts.name) return True
def process(self): (opts, args) = getopts() chkopts(opts) self.up_progress(10) config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() service = config.findby1service(opts.name) self.up_progress(10) sysv = SysVInit_RH(service['system_name'], service['system_command']) if sysv.restart(force=False) is False: raise KssCommandException(str(sysv.error_msg)) self.up_progress(50) self.logger.info('Restarted service. - service=%s' % (opts.name)) print >> sys.stdout, _('Restarted service. - service=%s') % (opts.name) return True