4 from sfa.client.sfi_commands import Commands
5 from sfa.rspecs.rspec import RSpec
6 from sfa.util.plxrn import xrn_to_hostname
8 command = Commands(usage="%prog [options]",
9 description="List all nodes in the RSpec. " +
10 "Use this to display the list of nodes on which it is " +
11 "possible to create a slice.")
14 if command.opts.infile:
15 rspec = RSpec(command.opts.infile)
16 nodes = rspec.version.get_nodes()
17 if command.opts.outfile:
18 sys.stdout = open(command.opts.outfile, 'w')
22 if node.get('component_id'):
23 hostname = xrn_to_hostname(node['component_id'])