예제 #1
0
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))
예제 #2
0
def snapshot(task):
    snapshot_name = 'snapshot'
    common_utils.execute(
        'nova', 'image-create', task.instance_uuid, snapshot_name)
예제 #3
0
파일: cron.py 프로젝트: pperezrubio/Tempo
def update():
    """Updates the crontab based on the state of the DB."""
    try:
        common_utils.execute('crontab', '-', process_input=crontab())
    except common_exception.ProcessExecutionError as e:
        logger.exception(e)