lib/vagrant-g5k/action/read_state.rb in vagrant-g5k-0.0.18 vs lib/vagrant-g5k/action/read_state.rb in vagrant-g5k-0.9.0
- old
+ new
@@ -18,11 +18,11 @@
def read_state(env)
machine = env[:machine]
conn = env[:g5k_connection]
id = machine.id
- local_storage = conn.check_local_storage(env)
+ local_storage = conn.check_storage(env)
if id.nil? and local_storage.nil?
return :not_created
end
if id.nil? and not local_storage.nil?
@@ -33,16 +33,12 @@
# is there a job running for this vm ?
job = conn.check_job(id)
if job.nil?
return :not_created
end
- if env[:machine].provider_config.net["type"] == "bridge"
- # is the subnet still there ?
- subnet_id = conn._find_subnet(id)
- if subnet_id.nil?
- return :subnet_missing
- end
- end
+
+ net_state = conn.check_net(id)
+ return net_state.to_sym unless net_state.nil?
return job["state"].to_sym
end
return :guru_meditation