Freezer-scheduler support both APIs

This patch allows freezer-scheduler to use either API v1 or v2
You can alter it using OS_BACKUP_API_VERSION env variable

Depends-On: I83000f8bf39eed41d067ed663de9f459439eca9a
Change-Id: I2e5724b1f1a75121952e2beb3844d2c489e4df68
This commit is contained in:
Saad Zaher 2018-02-16 12:31:52 +00:00
parent 8088ecada5
commit 075362ed70
2 changed files with 4 additions and 2 deletions

View File

@ -75,6 +75,8 @@ function configure_freezer_scheduler {
sudo chown $STACK_USER $FREEZER_JOBS_DIR
[ ! -d $FREEZER_LOG_DIR ] && sudo mkdir -m 755 -p $FREEZER_LOG_DIR
sudo chown $STACK_USER $FREEZER_LOG_DIR
sudo ls -lh $DEST
sudo ls -lh $DEST/logs
}

View File

@ -22,7 +22,7 @@ import threading
import time
from apscheduler.schedulers import background
from freezerclient.v1 import client
from freezerclient import utils as client_utils
from oslo_config import cfg
from oslo_log import log
@ -210,7 +210,7 @@ def main():
apiclient = None
if CONF.no_api is False:
try:
apiclient = client.Client(opts=CONF)
apiclient = client_utils.get_client_instance(opts=CONF)
if CONF.client_id:
apiclient.client_id = CONF.client_id
except Exception as e: