mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
(rubocop) Fix Style/TrailingCommaInHashLiteral
This commit is contained in:
parent
1aea79a9a1
commit
58f64b2843
6 changed files with 19 additions and 17 deletions
|
|
@ -6,3 +6,5 @@ Style/Documentation:
|
||||||
Enabled: False
|
Enabled: False
|
||||||
Style/HashSyntax:
|
Style/HashSyntax:
|
||||||
EnforcedStyle: hash_rockets
|
EnforcedStyle: hash_rockets
|
||||||
|
Style/TrailingCommaInHashLiteral:
|
||||||
|
EnforcedStyleForMultiline: comma
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ class Vmfloaty
|
||||||
:lifetime => options.lifetime,
|
:lifetime => options.lifetime,
|
||||||
:disk => options.disk,
|
:disk => options.disk,
|
||||||
:tags => tags,
|
:tags => tags,
|
||||||
:reason => options.reason
|
:reason => options.reason,
|
||||||
}
|
}
|
||||||
modify_hash.delete_if { |_, value| value.nil? }
|
modify_hash.delete_if { |_, value| value.nil? }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ class Utils
|
||||||
'url' => config['url'],
|
'url' => config['url'],
|
||||||
'user' => config['user'],
|
'user' => config['user'],
|
||||||
'token' => config['token'],
|
'token' => config['token'],
|
||||||
'type' => config['type'] || 'vmpooler'
|
'type' => config['type'] || 'vmpooler',
|
||||||
}
|
}
|
||||||
|
|
||||||
if config['services']
|
if config['services']
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ describe NonstandardPooler do
|
||||||
'Accept' => '*/*',
|
'Accept' => '*/*',
|
||||||
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
||||||
'User-Agent' => 'Faraday v0.9.2',
|
'User-Agent' => 'Faraday v0.9.2',
|
||||||
'X-Auth-Token' => 'token-value'
|
'X-Auth-Token' => 'token-value',
|
||||||
}
|
}
|
||||||
@get_request_headers = {
|
@get_request_headers = {
|
||||||
'Accept' => '*/*',
|
'Accept' => '*/*',
|
||||||
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
||||||
'User-Agent' => 'Faraday v0.9.2',
|
'User-Agent' => 'Faraday v0.9.2',
|
||||||
'X-Auth-Token' => 'token-value'
|
'X-Auth-Token' => 'token-value',
|
||||||
}
|
}
|
||||||
@get_request_headers_notoken = @get_request_headers.tap do |headers|
|
@get_request_headers_notoken = @get_request_headers.tap do |headers|
|
||||||
headers.delete('X-Auth-Token')
|
headers.delete('X-Auth-Token')
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ describe Service do
|
||||||
it 'reports the status of a token' do
|
it 'reports the status of a token' do
|
||||||
config = {
|
config = {
|
||||||
'user' => 'first.last',
|
'user' => 'first.last',
|
||||||
'url' => 'http://default.url'
|
'url' => 'http://default.url',
|
||||||
}
|
}
|
||||||
options = MockOptions.new('token' => 'token-value')
|
options = MockOptions.new('token' => 'token-value')
|
||||||
service = Service.new(options, config)
|
service = Service.new(options, config)
|
||||||
|
|
@ -69,7 +69,7 @@ describe Service do
|
||||||
'user' => config['user'],
|
'user' => config['user'],
|
||||||
'created' => '2017-09-22 02:04:18 +0000',
|
'created' => '2017-09-22 02:04:18 +0000',
|
||||||
'last_accessed' => '2017-09-22 02:04:28 +0000',
|
'last_accessed' => '2017-09-22 02:04:28 +0000',
|
||||||
'reserved_hosts' => []
|
'reserved_hosts' => [],
|
||||||
}
|
}
|
||||||
allow(Auth).to(receive(:token_status)
|
allow(Auth).to(receive(:token_status)
|
||||||
.with(nil, config['url'], 'token-value')
|
.with(nil, config['url'], 'token-value')
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,11 @@ describe Utils do
|
||||||
before :each do
|
before :each do
|
||||||
@vmpooler_results = {
|
@vmpooler_results = {
|
||||||
'centos-7-x86_64' => ['dlgietfmgeegry2.delivery.mycompany.net'],
|
'centos-7-x86_64' => ['dlgietfmgeegry2.delivery.mycompany.net'],
|
||||||
'ubuntu-1610-x86_64' => ['gdoy8q3nckuob0i.delivery.mycompany.net', 'ctnktsd0u11p9tm.delivery.mycompany.net']
|
'ubuntu-1610-x86_64' => ['gdoy8q3nckuob0i.delivery.mycompany.net', 'ctnktsd0u11p9tm.delivery.mycompany.net'],
|
||||||
}
|
}
|
||||||
@nonstandard_results = {
|
@nonstandard_results = {
|
||||||
'solaris-10-sparc' => ['sol10-10.delivery.mycompany.net', 'sol10-11.delivery.mycompany.net'],
|
'solaris-10-sparc' => ['sol10-10.delivery.mycompany.net', 'sol10-11.delivery.mycompany.net'],
|
||||||
'ubuntu-16.04-power8' => ['power8-ubuntu16.04-6.delivery.mycompany.net']
|
'ubuntu-16.04-power8' => ['power8-ubuntu16.04-6.delivery.mycompany.net'],
|
||||||
}
|
}
|
||||||
@vmpooler_output = <<-OUT.chomp
|
@vmpooler_output = <<-OUT.chomp
|
||||||
- dlgietfmgeegry2.delivery.mycompany.net (centos-7-x86_64)
|
- dlgietfmgeegry2.delivery.mycompany.net (centos-7-x86_64)
|
||||||
|
|
@ -95,14 +95,14 @@ describe Utils do
|
||||||
'vm' => {
|
'vm' => {
|
||||||
'url' => 'http://vmpooler.url',
|
'url' => 'http://vmpooler.url',
|
||||||
'user' => 'first.last.vmpooler',
|
'user' => 'first.last.vmpooler',
|
||||||
'token' => 'vmpooler-token'
|
'token' => 'vmpooler-token',
|
||||||
},
|
},
|
||||||
'ns' => {
|
'ns' => {
|
||||||
'url' => 'http://nspooler.url',
|
'url' => 'http://nspooler.url',
|
||||||
'user' => 'first.last.nspooler',
|
'user' => 'first.last.nspooler',
|
||||||
'token' => 'nspooler-token'
|
'token' => 'nspooler-token',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ describe Utils do
|
||||||
'running' => 9.66,
|
'running' => 9.66,
|
||||||
'state' => 'running',
|
'state' => 'running',
|
||||||
'ip' => '127.0.0.1',
|
'ip' => '127.0.0.1',
|
||||||
'domain' => 'delivery.mycompany.net'
|
'domain' => 'delivery.mycompany.net',
|
||||||
}}
|
}}
|
||||||
output = '- mcpy42eqjxli9g2.delivery.mycompany.net (ubuntu-1604-x86_64, 9.66/12 hours)'
|
output = '- mcpy42eqjxli9g2.delivery.mycompany.net (ubuntu-1604-x86_64, 9.66/12 hours)'
|
||||||
|
|
||||||
|
|
@ -189,10 +189,10 @@ describe Utils do
|
||||||
'state' => 'running',
|
'state' => 'running',
|
||||||
'tags' => {
|
'tags' => {
|
||||||
'user' => 'bob',
|
'user' => 'bob',
|
||||||
'role' => 'agent'
|
'role' => 'agent',
|
||||||
},
|
},
|
||||||
'ip' => '127.0.0.1',
|
'ip' => '127.0.0.1',
|
||||||
'domain' => 'delivery.mycompany.net'
|
'domain' => 'delivery.mycompany.net',
|
||||||
}}
|
}}
|
||||||
output = '- aiydvzpg23r415q.delivery.mycompany.net (redhat-7-x86_64, 7.67/48 hours, user: bob, role: agent)'
|
output = '- aiydvzpg23r415q.delivery.mycompany.net (redhat-7-x86_64, 7.67/48 hours, user: bob, role: agent)'
|
||||||
|
|
||||||
|
|
@ -213,7 +213,7 @@ describe Utils do
|
||||||
'os_triple' => 'solaris-11-sparc',
|
'os_triple' => 'solaris-11-sparc',
|
||||||
'reserved_by_user' => 'first.last',
|
'reserved_by_user' => 'first.last',
|
||||||
'reserved_for_reason' => '',
|
'reserved_for_reason' => '',
|
||||||
'hours_left_on_reservation' => 35.89
|
'hours_left_on_reservation' => 35.89,
|
||||||
}}
|
}}
|
||||||
output = '- sol11-9.delivery.mycompany.net (solaris-11-sparc, 35.89h remaining)'
|
output = '- sol11-9.delivery.mycompany.net (solaris-11-sparc, 35.89h remaining)'
|
||||||
|
|
||||||
|
|
@ -234,7 +234,7 @@ describe Utils do
|
||||||
'os_triple' => 'solaris-11-sparc',
|
'os_triple' => 'solaris-11-sparc',
|
||||||
'reserved_by_user' => 'first.last',
|
'reserved_by_user' => 'first.last',
|
||||||
'reserved_for_reason' => 'testing',
|
'reserved_for_reason' => 'testing',
|
||||||
'hours_left_on_reservation' => 35.89
|
'hours_left_on_reservation' => 35.89,
|
||||||
}}
|
}}
|
||||||
output = '- sol11-9.delivery.mycompany.net (solaris-11-sparc, 35.89h remaining, reason: testing)'
|
output = '- sol11-9.delivery.mycompany.net (solaris-11-sparc, 35.89h remaining, reason: testing)'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue