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
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. " +
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)