(POOLER-123) Update max_lifetime_upper_limit key

This commit switches the max_lifetime_upper_limit key from being a
symbol to being a string, which is what the config hash seems to contain.
This commit is contained in:
Brandon High 2019-12-03 17:36:13 -08:00
parent da48517750
commit 5739b567e9
No known key found for this signature in database
GPG key ID: 270079C784FCAFDE
2 changed files with 3 additions and 3 deletions

View file

@ -893,7 +893,7 @@ module Vmpooler
need_token! if Vmpooler::API.settings.config[:auth]
# in hours, defaults to one week
max_lifetime_upper_limit = config[:max_lifetime_upper_limit]
max_lifetime_upper_limit = config['max_lifetime_upper_limit']
if max_lifetime_upper_limit
max_lifetime_upper_limit = max_lifetime_upper_limit.to_i
if arg.to_i >= max_lifetime_upper_limit

View file

@ -136,7 +136,7 @@ describe Vmpooler::API::V1 do
it 'does not allow a lifetime to be initially past config 168' do
app.settings.set :config,
{ :config => { :max_lifetime_upper_limit => 168 } }
{ :config => { 'max_lifetime_upper_limit' => 168 } }
create_vm('testhost')
put "#{prefix}/vm/testhost", '{"lifetime":"200"}'
@ -148,7 +148,7 @@ describe Vmpooler::API::V1 do
it 'does not allow a lifetime to be extended past config 168' do
app.settings.set :config,
{ :config => { :max_lifetime_upper_limit => 168 } }
{ :config => { 'max_lifetime_upper_limit' => 168 } }
create_vm('testhost')
set_vm_data('testhost', "checkout", (Time.now - (69*60*60)))