deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: ec2 client: added if statements for when instance state, public IPs or private IPs are not returned by driver
Date Tue, 07 Aug 2012 17:30:15 GMT
Updated Branches:
  refs/heads/master 5f60d5e8d -> ac24be5fe


ec2 client: added if statements for when instance state, public IPs or private IPs are not
returned by driver


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

Branch: refs/heads/master
Commit: ac24be5fe9dd88c48f4886bbb8599c470172742c
Parents: 5f60d5e
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Sun Aug 5 21:58:21 2012 +1000
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue Aug 7 19:29:53 2012 +0200

----------------------------------------------------------------------
 server/lib/ec2/views/describe_instance_set.haml |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/ac24be5f/server/lib/ec2/views/describe_instance_set.haml
----------------------------------------------------------------------
diff --git a/server/lib/ec2/views/describe_instance_set.haml b/server/lib/ec2/views/describe_instance_set.haml
index 7a6a7b8..f3a35c9 100644
--- a/server/lib/ec2/views/describe_instance_set.haml
+++ b/server/lib/ec2/views/describe_instance_set.haml
@@ -5,16 +5,19 @@
       %imageId=item.image_id
       %instanceType=item.instance_profile.name
       %launchTime=item.launch_time || Time.now.to_s
-      %ipAddress=item.public_addresses.first.address
-      %privateIpAddress=item.public_addresses.first.address
-      %dnsName=item.public_addresses.first.address
-      %privateDnsName=item.private_addresses.first.address
+      - if item.public_addresses and not item.public_addresses.empty?
+        %ipAddress=item.public_addresses.first.address
+        %dnsName=item.public_addresses.first.address
+      - if item.private_addresses and not item.private_addresses.empty?
+        %privateIpAddress=item.private_addresses.first.address
+        %privateDnsName=item.private_addresses.first.address
       %architecture=item.instance_profile.architecture || 'i386'
       - if item.keyname
         %keyName=item.keyname
-      %instanceState
-        %code=instance_state_code(item.state.downcase)
-        %name=item.state.downcase
+      - if item.state
+        %instanceState
+          %code=instance_state_code(item.state.downcase)
+          %name=item.state.downcase
       %placement
         %availabilityZone=item.realm_id
         %groupName


Mime
View raw message