Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookstyle Bot Auto Corrections with Cookstyle 7.13.0 #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions files/default/vendor/gems/aix-wpar-0.2.0/aix-wpar.gemspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
$:.unshift(File.expand_path('../lib/', __FILE__))
$:.unshift(File.expand_path('lib', __dir__))
require 'wpars/version'

Gem::Specification.new do |gem|
gem.authors = ["Alain Dejoux"]
gem.email = ["adejoux@djouxtech.net"]
gem.description = %q{A wrapper for the AIX WPAR administration.}
gem.license = "MIT"
gem.summary = %q{A ruby library wrapper for the AIX WPAR administration.}
gem.homepage = "https://github.com/adejoux/aix-wpar"
gem.files = %w{LICENSE} + Dir.glob("*.gemspec") + Dir.glob("{lib,examples}/**/*")
gem.authors = ['Alain Dejoux']
gem.email = ['adejoux@djouxtech.net']
gem.description = %q(A wrapper for the AIX WPAR administration.)
gem.license = 'MIT'
gem.summary = %q(A ruby library wrapper for the AIX WPAR administration.)
gem.homepage = 'https://github.com/adejoux/aix-wpar'
gem.files = %w(LICENSE) + Dir.glob('*.gemspec') + Dir.glob('{lib,examples}/**/*')
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "aix-wpar"
gem.require_paths = ["lib"]
gem.name = 'aix-wpar'
gem.require_paths = ['lib']
gem.version = WPAR::VERSION

gem.add_dependency "mixlib-shellout", ["> 2", "< 4"]
gem.add_dependency 'mixlib-shellout', ['> 2', '< 4']
end
14 changes: 7 additions & 7 deletions files/default/vendor/gems/aix-wpar-0.2.0/examples/list_wpars.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
require 'wpars'
wpars = WPAR::WPARS.new(command: "ssh adxlpar2")
wpars = WPAR::WPARS.new(command: 'ssh adxlpar2')

wpars.generals.each do |entry|
puts entry.inspect
end

#puts wpars['kitchenwpar'].networks.inspect
#puts wpars['kitchenwpar'].devices.inspect
#puts wpars['testwpar2'].get_rootvg.inspect
# puts wpars['kitchenwpar'].networks.inspect
# puts wpars['kitchenwpar'].devices.inspect
# puts wpars['testwpar2'].get_rootvg.inspect

#start/stop examples
#wpars['testwpar2'].start
#wpars['testwpar2'].stop(force: true)
# start/stop examples
# wpars['testwpar2'].start
# wpars['testwpar2'].stop(force: true)
26 changes: 13 additions & 13 deletions files/default/vendor/gems/aix-wpar-0.2.0/examples/manage_wpar.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
require 'wpars'

#new wpar named testwpar
wpar = WPAR::WPAR.new(command: "ssh adxlpar2", name: "testwpar2")
# new wpar named testwpar
wpar = WPAR::WPAR.new(command: 'ssh adxlpar2', name: 'testwpar2')

#live stream output
wpar.live_stream=STDOUT
# live stream output
wpar.live_stream = STDOUT

#set hostname if different
wpar.general.hostname="testwpar2"
# set hostname if different
wpar.general.hostname = 'testwpar2'

#set auto start
wpar.general.auto="yes"
# set auto start
wpar.general.auto = 'yes'

#create wpar
# create wpar
wpar.create

#stop wpar
# stop wpar
wpar.stop(force: true)

#start wpar
# start wpar
wpar.start

#sync wpar
# sync wpar
wpar.sync

#delete
# delete
wpar.destroy(force: true)
23 changes: 11 additions & 12 deletions files/default/vendor/gems/aix-wpar-0.2.0/lib/wpars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class WPARS
VALID_OPTIONS = [
:command,
:version,
:debug
:debug,
]

def initialize(options={})
def initialize(options = {})
# handy, thanks net-ssh!
invalid_options = options.keys - VALID_OPTIONS
if invalid_options.any?
Expand All @@ -41,17 +41,16 @@ def initialize(options={})

def [](name)
if get_generals(name).nil?
return nil
return
end
wpar = WPAR.new(name: name,
WPAR.new(name: name,
command: @command,
general: get_generals(name),
networks: get_networks(name),
devices: get_devices(name),
mountpoints: get_mountpoints(name),
resource_controls: get_resource_controls(name),
securities: get_securities(name))
return wpar
end

def version
Expand All @@ -60,35 +59,35 @@ def version

def get_generals(name)
begin
@generals.select {|o| o.name == name}.first
@generals.select { |o| o.name == name }.first
rescue
nil
nil
end
end

def get_networks(name)
@networks.select {|o| o.name == name}
@networks.select { |o| o.name == name }
end

def get_devices(name)
@devices.select {|o| o.name == name}
@devices.select { |o| o.name == name }
end

def get_mountpoints(name)
@mountpoints.select {|o| o.name == name}
@mountpoints.select { |o| o.name == name }
end

def get_resource_controls(name)
begin
@resource_controls.select {|o| o.name == name}.first
@resource_controls.select { |o| o.name == name }.first
rescue
nil
end
end

def get_securities(name)
begin
@securities.select {|o| o.name == name}.first
@securities.select { |o| o.name == name }.first
rescue
nil
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class ExternalFailure < RuntimeError; end

def cmd(cmd: nil, live_stream: nil)
command = Mixlib::ShellOut.new(cmd)
command.live_stream=live_stream if live_stream
command.live_stream = live_stream if live_stream
command.run_command
command.error!
return command.stdout
command.stdout
end
module_function :cmd
end # module External
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(params)
@directory = params[:directory]
@owner = params[:owner]
@script = params[:script]
@auto = params[:auto] || "no"
@auto = params[:auto] || 'no'
@privateusr = params[:privateusr]
@checkpointable = params[:checkpointable]
@application = params[:application]
Expand All @@ -26,6 +26,5 @@ def initialize(params)
@architecture = params[:architecture]
@uuid = params[:uuid]
end

end
end
2 changes: 1 addition & 1 deletion files/default/vendor/gems/aix-wpar-0.2.0/lib/wpars/name.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module WPAR
module Name
def [](name)
select {|o| o.name == name}
select { |o| o.name == name }
end
end
end
6 changes: 2 additions & 4 deletions files/default/vendor/gems/aix-wpar-0.2.0/lib/wpars/network.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'ostruct'

#example of a WPAR network object
# example of a WPAR network object
# <WPAR::Network name="kitchenwpar", interface="en0", address="10.10.10.100", mask_prefix="255.255.255.0", broadcast="10.10.10.255">
module WPAR
class Network
Expand All @@ -16,14 +16,12 @@ def initialize(params)
end

def empty?
wpar_attributes.all?{|k,v| self.send(k).nil?}
wpar_attributes.all? { |k, _v| send(k).nil? }
end

def wpar_attributes
attrs = Network.instance_methods(false) - [:name, :command, :state, :empty?, :wpar_attributes ]
attrs - attrs.grep(/=$/)
end


end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module WPAR
class ResourceControl
attr_reader :name, :state, :active, :rset
attr_reader :procvirtmem, :totalvirtmem, :totalprocesses
attr_reader :procvirtmem, :totalvirtmem, :totalprocesses
attr_reader :totalptys, :totallargepages, :pct_msgids, :pct_semids
attr_reader :pct_pinmem, :totalthreads, :pct_shmids
attr_accessor :shares_cpu, :cpu, :shares_memory, :memory
Expand Down Expand Up @@ -29,7 +29,7 @@ def initialize(params)
end

def empty?
wpar_attributes.all?{|k,v| self.send(k).nil?}
wpar_attributes.all? { |k, _v| send(k).nil? }
end

def wpar_attributes
Expand Down
22 changes: 11 additions & 11 deletions files/default/vendor/gems/aix-wpar-0.2.0/lib/wpars/wpar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ def initialize(options = {})
@networks = options[:networks] || Array.new([Network.new(name: @name)])
@devices = options[:devices] || Array.new([Device.new(name: @name)])
@mountpoints = options[:mountpoints] || Array.new([Mountpoint.new(name: @name)])
@resource_control = options[:resource_controls] ||ResourceControl.new(name: @name)
@resource_control = options[:resource_controls] || ResourceControl.new(name: @name)
@security = options[:securities] || Security.new(name: @name)
end

def create(options = {})
MkWpar.create( name: @name,
MkWpar.create(name: @name,
command: @command,
wpar: self,
start: options[:start],
rootvg: options[:rootvg],
wparvg: options[:wparvg],
backupimage: options[:backupimage],
live_stream: @live_stream)
#update
# update
update(options)
end

Expand All @@ -55,21 +55,21 @@ def destroy(force: nil)
end

def stop(force: nil)
StopWpar.stop( name: @name, force: force, command: @command, live_stream: @live_stream)
StopWpar.stop(name: @name, force: force, command: @command, live_stream: @live_stream)

#update status
# update status
@general = LswparGeneral.new(command: @command).filter(@name)
end

def start()
StartWpar.start( name: @name, command: @command, live_stream: @live_stream)
def start
StartWpar.start(name: @name, command: @command, live_stream: @live_stream)

#update status
# update status
@general = LswparGeneral.new(command: @command).filter(@name)
end

def sync(directory: nil)
SyncWpar.sync( name: @name, command: @command, directory: directory, live_stream: @live_stream)
SyncWpar.sync(name: @name, command: @command, directory: directory, live_stream: @live_stream)
end

def update(options = {})
Expand All @@ -83,7 +83,7 @@ def update(options = {})
end

def add(address: nil, interface: nil, mask_prefix: nil, broadcast: nil)
params={}
params = {}
params[:name] = @name
params[:address] = address
params[:interface] = interface
Expand All @@ -95,7 +95,7 @@ def add(address: nil, interface: nil, mask_prefix: nil, broadcast: nil)
end

def get_rootvg
@devices.select { |o| o.rootvg == "yes"}
@devices.select { |o| o.rootvg == 'yes' }
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ module Wrapper
module Converter
def self.convert(output)
csv = CSV.new(output,
:col_sep => ':',
:headers => true,
:header_converters => :symbol,
:converters => :all)
csv.to_a.map {|row| row.to_hash }
col_sep: ':',
headers: true,
header_converters: :symbol,
converters: :all)
csv.to_a.map { |row| row.to_hash }
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
module WPAR
module Wrapper
class Lswpar

def list
data = parse(External.cmd(cmd: @command))

if block_given?
return data.each { |obj| yield obj }
data.each { |obj| yield obj }
else
return data
data
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module Wrapper
include Constants
include Converter
class LswparDevice < Lswpar

def initialize(options)
@command = "#{options[:command]} #{Constants::LSWPAR}D #{options[:name]}"
end

private

def parse(output) #:nodoc:
devices = []
# remove sharp character
Expand All @@ -23,7 +23,7 @@ def parse(output) #:nodoc:
device = Device.new(dev)
devices << device
end
return devices
devices
end
end
end
Expand Down
Loading