def switch_to_prod(self): # Go to production mode. try: get_cmd_output(['sudo', '/usr/bin/unblock_signals', KPLATPATH, 'production']) except Exception, e: ui_flash_error(message=str(e))
def switch_to_maint(self): # Go to maintenance mode. try: get_cmd_output(['sudo', '/usr/bin/unblock_signals', KPLATPATH, 'maintenance']) except Exception, e: ui_flash_error(message=str(e))
def switch_to_maint(self): # Go to maintenance mode. try: get_cmd_output( ['sudo', '/usr/bin/unblock_signals', KPLATPATH, 'maintenance']) except Exception, e: ui_flash_error(message=str(e))
def switch_to_prod(self): # Go to production mode. try: get_cmd_output( ['sudo', '/usr/bin/unblock_signals', KPLATPATH, 'production']) except Exception, e: ui_flash_error(message=str(e))
def move_file(src, dest, preserve_flag=0): if preserve_flag and os.path.isfile(dest): try: dest_stat = os.stat(dest) get_cmd_output(['sudo', 'chown', '%i:%i' % (dest_stat.st_uid, dest_stat.st_gid), src]) get_cmd_output(['sudo', 'chmod', oct(dest_stat.st_mode)[-4:], src]) except: pass get_cmd_output(['sudo', 'mv', '-f', src, dest])
def kws_mgt_delete(self): for kws_id in self.get_kws_mgt_query_sel_kws_list(): get_cmd_output(["sudo", "/usr/bin/kcdhelper", "--delete-kws", str(kws_id)]) return self.show_kws_mgt_query_page()
def get_status_line(): return get_cmd_output( ['sudo', '/usr/bin/unblock_signals', KPLATPATH, 'health']).strip('\r\n')
def read_file(file_path): return get_cmd_output(['sudo', 'cat', file_path])
def get_status_line(): return get_cmd_output(['sudo', '/usr/bin/unblock_signals', KPLATPATH, 'health']).strip('\r\n')