4 from sfa.client.sfi_commands import Commands
6 from sfa.rspecs.rspec import RSpec
8 from sfa.planetlab.plxrn import xrn_to_hostname
10 command = Commands(usage="%prog [options]",
11 description="List all slivers in the RSpec. " +
12 "Use this to display the list of nodes belonging to " +
14 command.add_show_attributes_option()
17 if command.opts.infile:
18 rspec = RSpec(command.opts.infile)
19 nodes = rspec.version.get_nodes_with_slivers()
21 if command.opts.showatt:
22 defaults = rspec.version.get_default_sliver_attributes()
25 for (name, value) in defaults:
26 print " %s: %s" % (name, value)
30 if node.get('component_id'):
31 hostname = xrn_to_hostname(node['component_id'])
34 if command.opts.showatt:
35 atts = rspec.version.get_sliver_attributes(hostname)
36 for (name, value) in atts:
37 print " %s: %s" % (name, value)