コード例 #1
0
    def action_backup_status(self, user_hash=None):
        with io.StringIO() as f:
            duplicity_log = logging.getLogger("duplicity")
            handler = logging.StreamHandler(f)
            duplicity_log.addHandler(handler)

            try:
                backup_status(user_hash=user_hash)
            except Exception as e:
                retval = False
                msg = str(e)
            else:
                retval = True
                msg = f.getvalue()

            duplicity_log.removeHandler(handler)

        return retval, msg
コード例 #2
0
    def action_backup_status(self, user_hash=None):
        with io.StringIO() as f:
            duplicity_log = logging.getLogger("duplicity")
            handler = logging.StreamHandler(f)
            duplicity_log.addHandler(handler)

            try:
                backup_status(user_hash=user_hash)
            except Exception as e:
                retval = False
                msg = str(e)
            else:
                retval = True
                msg = f.getvalue()

            duplicity_log.removeHandler(handler)

        return retval, msg
コード例 #3
0
 def cmd_backup_status(self, options, *args):
     """Get the status of the current backups"""
     setup_stoq()
     setup_logging()
     return backup_status(user_hash=options.user_hash)
コード例 #4
0
ファイル: main.py プロジェクト: hackedbellini/stoq-server
 def cmd_backup_status(self, options, *args):
     """Get the status of the current backups"""
     setup_stoq()
     setup_logging()
     return backup_status(user_hash=options.user_hash)