コード例 #1
0
ファイル: actions.py プロジェクト: pperezrubio/Tempo
def _backup(task, backup_type):
    task_uuid = task.uuid
    params = db.task_parameter_get_all_by_task_uuid(task_uuid)
    rotation = params.get('rotation', '0')

    try:
        rotation = int(rotation)
    except ValueError:
        logger.error("Invalid rotation '%(rotation)s' for task"
                     " '%(task_uuid)s'" % locals())
        rotation = 0

    backup_name = backup_type
    common_utils.execute(
        'nova', 'backup', task.instance_uuid, backup_name, backup_type,
        str(rotation))