Skip to content

Commit

Permalink
Merge pull request #104 from nwolfe/maint/dont-require-fallback-config
Browse files Browse the repository at this point in the history
(maint) Don't require configuration file for get
  • Loading branch information
Samuel committed Oct 9, 2020
2 parents e146857 + ad81969 commit 6d1130b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/vmfloaty/abs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ def self.retrieve(verbose, os_types, token, url, user, config, _ondemand = nil)
conn.headers['X-AUTH-TOKEN'] = token if token

saved_job_id = user + "-" + DateTime.now.strftime('%Q')
vmpooler_config = Utils.get_vmpooler_service_config(config['vmpooler_fallback'])
req_obj = {
:resources => os_types,
:job => {
Expand All @@ -258,9 +257,14 @@ def self.retrieve(verbose, os_types, token, url, user, config, _ondemand = nil)
:user => user,
},
},
:vm_token => vmpooler_config['token'] # request with this token, on behalf of this user
}

if config['vmpooler_fallback'] # optional and not available as cli flag
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
Expand Down

0 comments on commit 6d1130b

Please sign in to comment.