lib/linux_admin/yum.rb in linux_admin-0.9.1 vs lib/linux_admin/yum.rb in linux_admin-0.9.2
- old
+ new
@@ -53,11 +53,16 @@
def self.update(*packages)
cmd = "yum -y update"
params = {nil => packages} unless packages.blank?
- run!(cmd, :params => params)
+ out = run!(cmd, :params => params)
+
+ # Handle errors that exit 0 https://bugzilla.redhat.com/show_bug.cgi?id=1141318
+ raise AwesomeSpawn::CommandResultError.new(out.error, out) if out.error.include?("No Match for argument")
+
+ out
end
def self.version_available(*packages)
raise ArgumentError, "packages requires at least one package name" if packages.blank?
@@ -108,13 +113,13 @@
collect_content = false if line.start_with?(index_end)
collect_content = true if line.start_with?(index_start)
next if line.start_with?(index_start)
next if !collect_content
- repo_id, repo_name, status = line.split(/\s{2,}/)
+ repo_id, _repo_name, _status = line.split(/\s{2,}/)
array.push(repo_id)
end
end
end
end
-Dir.glob(File.join(File.dirname(__FILE__), "yum", "*.rb")).each { |f| require f }
\ No newline at end of file
+Dir.glob(File.join(File.dirname(__FILE__), "yum", "*.rb")).each { |f| require f }