Beispiel #1
0
    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))
Beispiel #2
0
    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))
Beispiel #3
0
    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))
Beispiel #4
0
    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))
Beispiel #5
0
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]) 
Beispiel #6
0
 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()
Beispiel #7
0
def get_status_line():
    return get_cmd_output(
        ['sudo', '/usr/bin/unblock_signals', KPLATPATH,
         'health']).strip('\r\n')
Beispiel #8
0
def read_file(file_path):
    return get_cmd_output(['sudo', 'cat', file_path])
Beispiel #9
0
def get_status_line():
    return get_cmd_output(['sudo', '/usr/bin/unblock_signals', KPLATPATH, 'health']).strip('\r\n')