Skip to content

Commit

Permalink
Merge 7ba8453 into 1cabe1a
Browse files Browse the repository at this point in the history
  • Loading branch information
djberg96 committed Dec 21, 2020
2 parents 1cabe1a + 7ba8453 commit b460845
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/linux_admin/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module LinuxAdmin
class Deb < Package
APT_CACHE_CMD = '/usr/bin/apt-cache'

def self.from_line(apt_cache_line, in_description=false)
def self.from_line(apt_cache_line, _in_description=false)
tag,value = apt_cache_line.split(':')
tag = tag.strip.downcase
[tag, value]
Expand Down
2 changes: 0 additions & 2 deletions lib/linux_admin/logical_volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def extend_with(vg)
self
end

private

def self.bytes_to_string(bytes)
if bytes > 1_073_741_824 # 1.gigabytes
Expand All @@ -68,7 +67,6 @@ def self.bytes_to_string(bytes)
end
end

public

def self.create(name, vg, value)
self.scan # initialize local logical volumes
Expand Down
2 changes: 1 addition & 1 deletion lib/linux_admin/network_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ def parse_ip6(ip_output, scope)
end
end

Dir.glob(File.join(File.dirname(__FILE__), "network_interface", "*.rb")).each { |f| require f }
Dir.glob(File.join(File.dirname(__FILE__), "network_interface", "*.rb")).sort.each { |f| require f }
2 changes: 1 addition & 1 deletion lib/linux_admin/registration_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def install_server_certificate(server, cert_path)
end
end

Dir.glob(File.join(File.dirname(__FILE__), "registration_system", "*.rb")).each { |f| require f }
Dir.glob(File.join(File.dirname(__FILE__), "registration_system", "*.rb")).sort.each { |f| require f }
6 changes: 3 additions & 3 deletions lib/linux_admin/registration_system/subscription_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@ def available_subscriptions
parse_output(output).each_with_object({}) { |i, h| h[i[:pool_id]] = i }
end

def enable_repo(repo, options = nil)
def enable_repo(repo, _options = nil)
cmd = "subscription-manager repos"
params = {"--enable=" => repo}

logger.info("#{self.class.name}##{__method__} Enabling repository: #{repo}")
run!(cmd, :params => params)
end

def disable_repo(repo, options = nil)
def disable_repo(repo, _options = nil)
cmd = "subscription-manager repos"
params = {"--disable=" => repo}

run!(cmd, :params => params)
end

def all_repos(options = nil)
def all_repos(_options = nil)
cmd = "subscription-manager repos"
output = run!(cmd).output

Expand Down
3 changes: 1 addition & 2 deletions lib/linux_admin/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def self.service_type(reload = false)
end

class << self
private
alias_method :orig_new, :new
end

Expand Down Expand Up @@ -38,4 +37,4 @@ def self.service_type_uncached
end
end

Dir.glob(File.join(File.dirname(__FILE__), "service", "*.rb")).each { |f| require f }
Dir.glob(File.join(File.dirname(__FILE__), "service", "*.rb")).sort.each { |f| require f }
2 changes: 0 additions & 2 deletions lib/linux_admin/volume.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module LinuxAdmin
class Volume
private

def self.process_volume_display_line(line)
groups = VolumeGroup.scan
Expand All @@ -10,7 +9,6 @@ def self.process_volume_display_line(line)
return fields, vg
end

protected

def self.scan_volumes(cmd)
volumes = []
Expand Down
5 changes: 2 additions & 3 deletions lib/linux_admin/yum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def self.repo_list(scope = "enabled")
parse_repo_list_output(output)
end

private

def self.parse_repo_dir(dir)
repo_files = Dir.glob(File.join(dir, '*.repo'))
Expand All @@ -99,7 +98,7 @@ def self.parse_repo_dir(dir)
def self.parse_repo_file(file)
int_keys = ["enabled", "cost", "gpgcheck", "sslverify", "metadata_expire"]
content = IniFile.load(file).to_h
content.each do |name, data|
content.each do |_name, data|
int_keys.each { |k| data[k] = data[k].to_i if data.has_key?(k) }
end
end
Expand All @@ -122,4 +121,4 @@ def self.parse_repo_list_output(content)
end
end

Dir.glob(File.join(File.dirname(__FILE__), "yum", "*.rb")).each { |f| require f }
Dir.glob(File.join(File.dirname(__FILE__), "yum", "*.rb")).sort.each { |f| require f }

0 comments on commit b460845

Please sign in to comment.