exe/conoharant in conoha-0.2.1 vs exe/conoharant in conoha-0.2.2
- old
+ new
@@ -106,10 +106,18 @@
end
image_id = status['images'][-1]
ram = config['ram']
puts "conoha restore #{image_id} #{ram}"
server_id = Conoha.create_from_image image_id, ram
+ loop do
+ sleep 10
+ result = Conoha.status_of server_id
+ break if result == "ACTIVE"
+ puts "# Current status is \"#{result}\", not \"ACTIVE\"."
+ puts "# Re-check after 10 seconds..."
+ end
+ puts "# OK!"
status['status'] = 'running'
status['id'] = server_id
dump_conoharant_status status
when 'clean'
images = status['images']
@@ -127,9 +135,15 @@
when 'browse'
server_id = status['id']
ipaddress = ipv4(Conoha.ip_address_of(server_id))
port = ARGV[1].nil? ? '' : ":#{ARGV[1]}"
command = "xdg-open http://#{ipaddress}#{port}"
+ puts command
+ system command
+when 'sftp'
+ server_id = status['id']
+ ipaddress = ipv4(Conoha.ip_address_of(server_id))
+ command = "sftp #{ipaddress}"
puts command
system command
else
STDERR.puts 'Invalid argument.'
exit 1