4 from sfa.client.sfi_commands import Commands
5 from sfa.rspecs.rspec import RSpec
6 from sfa.util.xrn import Xrn
8 command = Commands(usage="%prog [options]",
9 description="List all links in the RSpec. " +
10 "Use this to display the list of available links. " )
13 if command.opts.infile:
14 rspec = RSpec(command.opts.infile)
15 links = rspec.version.get_links()
16 if command.opts.outfile:
17 sys.stdout = open(command.opts.outfile, 'w')
20 ifname1 = Xrn(link['interface1']['component_id']).get_leaf()
21 ifname2 = Xrn(link['interface2']['component_id']).get_leaf()
22 print "%s %s" % (ifname1, ifname2)