X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=clientbin%2FsfiListLinks.py;h=140cbb64af90846dba9e8fd623bb00bd3479f4a6;hp=a4720ca12bb55e72f5f4ac671b610cca0609eaa1;hb=HEAD;hpb=a0b08c3177b6273ad22f3882cd62495743ed404c diff --git a/clientbin/sfiListLinks.py b/clientbin/sfiListLinks.py index a4720ca1..140cbb64 100755 --- a/clientbin/sfiListLinks.py +++ b/clientbin/sfiListLinks.py @@ -1,13 +1,13 @@ -#! /usr/bin/env python +#!/usr/bin/env python3 import sys from sfa.client.sfi_commands import Commands from sfa.rspecs.rspec import RSpec -from sfa.util.xrn import Xrn +from sfa.util.xrn import Xrn command = Commands(usage="%prog [options]", - description="List all links in the RSpec. " + - "Use this to display the list of available links. " ) + description="List all links in the RSpec. " + + "Use this to display the list of available links. ") command.prep() if command.opts.infile: @@ -15,12 +15,8 @@ if command.opts.infile: links = rspec.version.get_links() if command.opts.outfile: sys.stdout = open(command.opts.outfile, 'w') - + for link in links: ifname1 = Xrn(link['interface1']['component_id']).get_leaf() ifname2 = Xrn(link['interface2']['component_id']).get_leaf() - print "%s %s" % (ifname1, ifname2) - - - - + print("%s %s" % (ifname1, ifname2))