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