lib/vagrant-aws/provider.rb in vagrant-aws-mkubenka-0.7.2.pre.14 vs lib/vagrant-aws/provider.rb in vagrant-aws-mkubenka-0.7.2.pre.16
- old
+ new
@@ -39,9 +39,21 @@
# Return the MachineState object
Vagrant::MachineState.new(state_id, short, long)
end
+ def region
+ # Return the region associated with the instance if the machine
+ # has already been launched, or return the default region configured.
+ machine_region_file = @machine.data_dir.join("region")
+
+ if File.exists?(machine_region_file)
+ return File.read(machine_region_file)
+ else
+ return @machine.provider_config.region
+ end
+ end
+
def to_s
id = @machine.id.nil? ? "new" : @machine.id
"AWS (#{id})"
end
end