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
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)