X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=clientbin%2FsfiAddSliver.py;h=72b649b553e3b3ca8dab023e1edabc4a00c10164;hb=78e5fb75e3793ae9dfce7f1bbd4a2b0f27b7ecc6;hp=6e6042cec59c088527e59bee554f04319aaec640;hpb=5a6cbf4fa6837c81354b616d4cfa0352ec5367be;p=sfa.git diff --git a/clientbin/sfiAddSliver.py b/clientbin/sfiAddSliver.py index 6e6042ce..72b649b5 100755 --- a/clientbin/sfiAddSliver.py +++ b/clientbin/sfiAddSliver.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#!/usr/bin/env python3 import sys @@ -16,16 +16,16 @@ command.add_nodefile_option() command.prep() if not command.opts.nodefile: - print "Missing node list -- exiting" + print("Missing node list -- exiting") command.parser.print_help() sys.exit(1) - + if command.opts.infile: infile = open(command.opts.infile) else: infile = sys.stdin if command.opts.outfile: - outfile = open(command.opts.outfile,"w") + outfile = open(command.opts.outfile, "w") else: outfile = sys.stdout ad_rspec = RSpec(infile) @@ -34,12 +34,13 @@ version_manager = VersionManager() try: type = ad_rspec.version.type version_num = ad_rspec.version.version - request_version = version_manager._get_version(type, version_num, 'request') + request_version = version_manager._get_version( + type, version_num, 'request') request_rspec = RSpec(version=request_version) request_rspec.version.merge(ad_rspec) request_rspec.version.add_slivers(nodes) except: logger.log_exc("sfiAddSliver failed with nodes %s" % nodes) sys.exit(1) -print >>outfile, request_rspec.toxml() +print(request_rspec.toxml(), file=outfile) sys.exit(0)