mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Merge pull request #360 from highb/2020-03-05_unsafe_rubocop_fixes
"Unsafe" rubocop fixes
This commit is contained in:
commit
f85f5126e8
19 changed files with 46 additions and 9 deletions
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
class API < Sinatra::Base
|
||||
def initialize
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
class API
|
||||
class Dashboard < Sinatra::Base
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
|
||||
class API
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
class API
|
||||
class Reroute < Sinatra::Base
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
class API
|
||||
class V1 < Sinatra::Base
|
||||
|
|
@ -934,7 +936,7 @@ module Vmpooler
|
|||
end
|
||||
end
|
||||
|
||||
if failure.size > 0
|
||||
if !failure.empty?
|
||||
status 400
|
||||
result['failure'] = failure
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
class Dashboard < Sinatra::Base
|
||||
def config
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
class DummyStatsd
|
||||
attr_reader :server, :port, :prefix
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'connection_pool'
|
||||
|
||||
module Vmpooler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rubygems' unless defined?(Gem)
|
||||
|
||||
module Vmpooler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rubygems' unless defined?(Gem)
|
||||
|
||||
module Vmpooler
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'vmpooler/providers'
|
||||
require 'spicy-proton'
|
||||
|
||||
|
|
@ -54,7 +56,7 @@ module Vmpooler
|
|||
pool_keys.each do |k|
|
||||
to_set[k] = pool[k]
|
||||
end
|
||||
to_set['alias'] = pool['alias'].join(',') if to_set.has_key?('alias')
|
||||
to_set['alias'] = pool['alias'].join(',') if to_set.key?('alias')
|
||||
$redis.hmset("vmpooler__pool__#{pool['name']}", to_set.to_a.flatten) unless to_set.empty?
|
||||
end
|
||||
previously_configured_pools.each do |pool|
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'pathname'
|
||||
|
||||
module Vmpooler
|
||||
|
|
@ -37,7 +39,7 @@ module Vmpooler
|
|||
# we don't exactly know if the provider name matches the main file name that should be loaded
|
||||
# so we use globs to get everything like the name
|
||||
# this could mean that vsphere5 and vsphere6 are loaded when only vsphere5 is used
|
||||
Dir.glob(File.join(gem_path, "*#{name}*.rb")).each do |file|
|
||||
Dir.glob(File.join(gem_path, "*#{name}*.rb")).sort.each do |file|
|
||||
require file
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
class PoolManager
|
||||
class Provider
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'yaml'
|
||||
require 'vmpooler/providers/base'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'vmpooler/providers/base'
|
||||
|
||||
module Vmpooler
|
||||
|
|
@ -483,9 +485,9 @@ module Vmpooler
|
|||
end
|
||||
|
||||
# vSphere helper methods
|
||||
ADAPTER_TYPE = 'lsiLogic'.freeze
|
||||
DISK_TYPE = 'thin'.freeze
|
||||
DISK_MODE = 'persistent'.freeze
|
||||
ADAPTER_TYPE = 'lsiLogic'
|
||||
DISK_TYPE = 'thin'
|
||||
DISK_MODE = 'persistent'
|
||||
|
||||
def ensured_vsphere_connection(connection_pool_object)
|
||||
connection_pool_object[:connection] = connect_to_vsphere unless vsphere_connection_ok?(connection_pool_object[:connection])
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rubygems' unless defined?(Gem)
|
||||
require 'statsd'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Vmpooler
|
||||
VERSION = '0.10.3'.freeze
|
||||
VERSION = '0.10.3'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue