You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/11/08 15:03:00 UTC

[3/4] git commit: VSphere: Report instance launch time

VSphere: Report instance launch time


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/587ff9e6
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/587ff9e6
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/587ff9e6

Branch: refs/heads/master
Commit: 587ff9e63d10b9cf40da656802e88bc6a4cc6ff0
Parents: aecefd4
Author: Michal Fojtik <mf...@redhat.com>
Authored: Thu Oct 25 14:18:44 2012 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Thu Nov 8 15:02:35 2012 +0100

----------------------------------------------------------------------
 .../deltacloud/drivers/vsphere/vsphere_driver.rb   |    2 ++
 server/views/instances/show.xml.haml               |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/587ff9e6/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
index 43818fe..d4879ef 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -182,6 +182,7 @@ module Deltacloud::Drivers::Vsphere
           else
             public_addresses = [InstanceAddress.new(vm.guest[:net].first[:ipAddress].first)]
           end
+          p vm.runtime[:bootTime]
           Instance.new(
             :id => properties[:name],
             :name => properties[:name],
@@ -194,6 +195,7 @@ module Deltacloud::Drivers::Vsphere
             :private_addresses => [],
             :instance_profile => instance_profile,
             :actions => instance_actions_for( instance_state ),
+            :launch_time => vm.runtime.props[:bootTime],
             :create_image => true
           )
         end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/587ff9e6/server/views/instances/show.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/instances/show.xml.haml b/server/views/instances/show.xml.haml
index a91c0c5..6a888f7 100644
--- a/server/views/instances/show.xml.haml
+++ b/server/views/instances/show.xml.haml
@@ -26,7 +26,7 @@
         %link{:rel => 'run', :method => :post, :href => "#{run_instance_url(@instance.id)};id=#{@instance.id}"}
       - if @instance.can_create_image?
         %link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{@instance.id}"}
-  - if @instance.instance_variables.include?("@launch_time")
+  - if @instance.launch_time
     %launch_time<
       =@instance.launch_time
   - if @instance.public_addresses