nodes are Node objects
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 11 Nov 2011 05:10:05 +0000 (00:10 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 11 Nov 2011 05:10:05 +0000 (00:10 -0500)
sfa/client/sfiListNodes.py
sfa/client/sfiListSlivers.py

index 29fc80d..3de1657 100755 (executable)
@@ -19,9 +19,7 @@ if command.opts.infile:
     
     for node in nodes:
         hostname = None
-        if node.get('component_name'):
-            hostname = node['component_name']
-        elif node.get('component_id'):
+        if node.get('component_id'):
             hostname = xrn_to_hostname(node['component_id'])
         if hostname:
             print hostname 
index cf76823..c869f61 100755 (executable)
@@ -3,6 +3,7 @@
 import sys
 from sfa.client.sfi_commands import Commands
 from sfa.rspecs.rspec import RSpec
+from sfa.util.plxrn import xrn_to_hostname
 
 command = Commands(usage="%prog [options]",
                    description="List all slivers in the RSpec. " + 
@@ -23,10 +24,14 @@ if command.opts.infile:
                 print "  %s: %s" % (name, value)        
 
     for node in nodes:
-        print node
-        if command.opts.showatt:
-            atts = rspec.version.get_sliver_attributes(node)
-            for (name, value) in atts:
-                print "  %s: %s" % (name, value)
+        hostname = None
+        if node.get('component_id'):
+            hostname = xrn_to_hostname(node['component_id'])
+        if hostname:
+            print hostname
+            if command.opts.showatt:
+                atts = rspec.version.get_sliver_attributes(hostname)
+                for (name, value) in atts:
+                    print "  %s: %s" % (name, value)