1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

minor cleanups

This commit is contained in:
Ohad Levy 2012-01-25 14:30:24 +02:00 committed by Ohad Levy
parent 5e1c73029c
commit e38b82666a
3 changed files with 8 additions and 6 deletions

View file

@ -62,7 +62,7 @@ module Fog
end
rescue ::Libvirt::ConnectionError
raise Fog::Errors::Error.new("Error making a connection to libvirt URI #{@uri.uri}:\n#{$!}")
raise Fog::Errors::Error.new("Error making a connection to libvirt URI #{uri.uri}:\n#{$!}")
end
end
@ -86,8 +86,7 @@ module Fog
end
end
end
newuri=uri+append
return newuri
uri+append
end
def respond_to?(method, *)

View file

@ -56,9 +56,13 @@ module Fog
super
end
def new?
uuid.nil?
end
def save
raise Fog::Errors::Error.new('Resaving an existing server may create a duplicate') if uuid
raise Fog::Errors::Error.new('Resaving an existing server may create a duplicate') unless new?
validate_template_options
@ -71,7 +75,7 @@ module Fog
# We either now have xml provided by the user or generated by the template
begin
if xml
self.raw = self.persistent ? connection.raw.define_domain_xml(xml) : connection.raw.create_domain_xml(xml)
self.raw = persistent ? connection.raw.define_domain_xml(xml) : connection.raw.create_domain_xml(xml)
end
rescue
raise Fog::Errors::Error.new("Error saving the server: #{$!}")

View file

@ -19,7 +19,6 @@ module Fog
end
end
end
end
end