Skip to content

Commit

Permalink
Fix Layout/IndentationWidth cop
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Jul 15, 2024
1 parent 0fb9b4c commit 0c481b2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lib/fog/libvirt/models/compute/util/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def xml_element(xml, path, attribute=nil)
end

def xml_elements(xml, path, attribute=nil)
xml = Nokogiri::XML(xml)
attribute.nil? ? (xml/path).map : (xml/path).map{|element| element[attribute.to_sym]}
xml = Nokogiri::XML(xml)
attribute.nil? ? (xml/path).map : (xml/path).map{|element| element[attribute.to_sym]}
end

def to_xml template_name = nil
Expand Down
20 changes: 10 additions & 10 deletions lib/fog/libvirt/requests/compute/list_volumes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ def volume_to_attributes(vol)
return nil if format_type == "dir"

begin
{
:pool_name => vol.pool.name,
:key => vol.key,
:id => vol.key,
:path => vol.path,
:name => vol.name,
:format_type => format_type,
:allocation => bytes_to_gb(vol.info.allocation),
:capacity => bytes_to_gb(vol.info.capacity),
}
{
:pool_name => vol.pool.name,
:key => vol.key,
:id => vol.key,
:path => vol.path,
:name => vol.name,
:format_type => format_type,
:allocation => bytes_to_gb(vol.info.allocation),
:capacity => bytes_to_gb(vol.info.capacity),
}
rescue ::Libvirt::RetrieveError, ::Libvirt::Error
return nil # If there are issues during stat of volume file
end
Expand Down
12 changes: 6 additions & 6 deletions tests/libvirt/models/compute/pools_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
pools = Fog::Compute[:libvirt].pools

tests('The pools collection') do
test('should not be empty') { not pools.empty? }
test('should be a kind of Fog::Libvirt::Compute::Pools') { pools.kind_of? Fog::Libvirt::Compute::Pools }
tests('should be able to reload itself').succeeds { pools.reload }
tests('should be able to get a model') do
tests('by instance id').succeeds { pools.get pools.first.uuid }
end
test('should not be empty') { not pools.empty? }
test('should be a kind of Fog::Libvirt::Compute::Pools') { pools.kind_of? Fog::Libvirt::Compute::Pools }
tests('should be able to reload itself').succeeds { pools.reload }
tests('should be able to get a model') do
tests('by instance id').succeeds { pools.get pools.first.uuid }
end
end
end

0 comments on commit 0c481b2

Please sign in to comment.