From 56f0896d48c6e23dc22e3a935ac918673f1b4980 Mon Sep 17 00:00:00 2001 From: Nate Wolfe Date: Wed, 23 Sep 2020 15:52:32 -0700 Subject: [PATCH] (maint) Don't require configuration file for get Make the vmpooler_fallback optional for cases when there's no configuration file and everything is specified on the CLI invocation. --- lib/vmfloaty/abs.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vmfloaty/abs.rb b/lib/vmfloaty/abs.rb index 2426c32..a2bb6bc 100644 --- a/lib/vmfloaty/abs.rb +++ b/lib/vmfloaty/abs.rb @@ -249,7 +249,6 @@ class ABS conn.headers['X-AUTH-TOKEN'] = token if token saved_job_id = DateTime.now.strftime('%Q') - vmpooler_config = Utils.get_vmpooler_service_config(config['vmpooler_fallback']) req_obj = { :resources => os_types, :job => { @@ -258,9 +257,14 @@ class ABS :user => user, }, }, - :vm_token => vmpooler_config['token'] # request with this token, on behalf of this user } + if config['vmpooler_fallback'] + vmpooler_config = Utils.get_vmpooler_service_config(config['vmpooler_fallback']) + # request with this token, on behalf of this user + req_obj[:vm_token] = vmpooler_config['token'] + end + if config['priority'] req_obj[:priority] = if config['priority'] == 'high' 1