def _GET(self, *param, **params): host_id = self.chk_hostby1(param) if host_id is None: return web.notfound() self.view.host_id = host_id config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() service = config.findby1service(param[1]) if not service: self.logger.debug("Get service status failed. Service not found.") return web.notfound("Service not found") sysv = SysVInit_RH(service['system_name'], service['system_command']) status = { "status": sysv.status(), "autostart": sysv.onboot(), "readonly": service["system_readonly"], } if self.__template__["media"] == 'json': self.view.status = json_dumps(status) else: self.view.status = status return True
def _GET(self, *param, **params): host_id = self.chk_hostby1(param) if host_id is None: return web.notfound() self.view.host_id = host_id config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() service = config.findby1service(param[1]) if not service: self.logger.debug("Get service status failed. Service not found.") return web.notfound("Service not found") sysv = SysVInit_RH(service['system_name'], service['system_command']) status = {"status":sysv.status(), "autostart":sysv.onboot(), "readonly":service["system_readonly"], } if self.__template__["media"] == 'json': self.view.status = json_dumps(status) else: self.view.status = status return True
def _GET(self, *param, **params): host_id = self.chk_hostby1(param) if host_id is None: return web.notfound() config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() displays = [] for service in config.get_services(): sysv = SysVInit_RH(service["system_name"], service["system_command"]) display = { "name": service["system_name"], "readonly": service["system_readonly"], "display_name": service["display_name"], "description": service["display_description"], "status": sysv.status(), "autostart": sysv.onboot(), } displays.append(display) self.view.services = displays return True
def _GET(self, *param, **params): host_id = self.chk_hostby1(param) if host_id is None: return web.notfound() config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() displays = [] for service in config.get_services(): sysv = SysVInit_RH(service['system_name'], service['system_command']) display = { 'name': service['system_name'], 'readonly': service['system_readonly'], 'display_name': service['display_name'], 'description': service['display_description'], 'status': sysv.status(), 'autostart': sysv.onboot(), } displays.append(display) self.view.services = displays return True
def _GET(self, *param, **params): host_id = self.chk_hostby1(param) if host_id is None: return web.notfound() config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() service = config.findby1service(param[1]) if not service: self.logger.debug("Get service info failed. Service not found.") return web.notfound("Service not found") sysv = SysVInit_RH(service['system_name'], service['system_command']) display = { 'name' : service['system_name'], 'display_name' : service['display_name'], 'description' : service['display_description'], 'status' : sysv.status(), 'autostart' : sysv.onboot(), } self.view.service = display return True
def _GET(self, *param, **params): host_id = self.chk_hostby1(param) if host_id is None: return web.notfound() config = ServiceConfigParam(SERVICE_XML_FILE) config.load_xml_config() displays = [] for service in config.get_services(): sysv = SysVInit_RH(service['system_name'], service['system_command']) display = { 'name' : service['system_name'], 'readonly': service['system_readonly'], 'display_name' : service['display_name'], 'description' : service['display_description'], 'status' : sysv.status(), 'autostart' : sysv.onboot(), } displays.append(display) self.view.services = displays return True