Merge branch 'upstreammaster'
[sfa.git] / sfa / client / sfiListSlivers.py
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)