mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[Libvirt] Remove the newlines after running the local ip_command
This commit is contained in:
parent
22e804c3a9
commit
f23155c4f2
1 changed files with 6 additions and 1 deletions
|
@ -355,8 +355,13 @@ module Fog
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#Strip any new lines from the string
|
||||||
|
ip_address=ip_address.chomp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# The Ip-address command has been run either local or remote now
|
||||||
|
|
||||||
if ip_address==""
|
if ip_address==""
|
||||||
#The grep didn't find an ip address result"
|
#The grep didn't find an ip address result"
|
||||||
ip_address=nil
|
ip_address=nil
|
||||||
|
@ -366,7 +371,7 @@ module Fog
|
||||||
# otherwise we return nil
|
# otherwise we return nil
|
||||||
unless ip_address=~/^(\d{1,3}\.){3}\d{1,3}$/
|
unless ip_address=~/^(\d{1,3}\.){3}\d{1,3}$/
|
||||||
raise Fog::Errors::Error.new(
|
raise Fog::Errors::Error.new(
|
||||||
"The result of #{ip_command} does not a valid ip-address format\n"+
|
"The result of #{ip_command} does not have valid ip-address format\n"+
|
||||||
"Result was: #{ip_address}\n"
|
"Result was: #{ip_address}\n"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue