5 from sfa.client.sfi_commands import Commands
7 from sfa.rspecs.rspec import RSpec
9 from sfa.planetlab.plxrn import xrn_to_hostname
11 command = Commands(usage="%prog [options]",
12 description="List all nodes in the RSpec. " +
13 "Use this to display the list of nodes on which it is " +
14 "possible to create a slice.")
17 if command.opts.infile:
18 rspec = RSpec(command.opts.infile)
19 nodes = rspec.version.get_nodes()
20 if command.opts.outfile:
21 sys.stdout = open(command.opts.outfile, 'w')
25 if node.get('component_id'):
26 hostname = xrn_to_hostname(node['component_id'])