From 78e5fb75e3793ae9dfce7f1bbd4a2b0f27b7ecc6 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 29 Mar 2019 11:59:50 +0100 Subject: [PATCH] another pass onf shebangs --- clientbin/sfadump.py | 2 +- clientbin/sfiAddAttribute.py | 2 +- clientbin/sfiAddLinks.py | 2 +- clientbin/sfiAddSliver.py | 2 +- clientbin/sfiDeleteAttribute.py | 2 +- clientbin/sfiDeleteSliver.py | 2 +- clientbin/sfiListLinks.py | 2 +- clientbin/sfiListNodes.py | 2 +- clientbin/sfiListSlivers.py | 2 +- sfa/client/sfi_commands.py | 2 +- sfatables/sfatables | 18 +++++++++--------- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/clientbin/sfadump.py b/clientbin/sfadump.py index d46fbfb4..f42615b2 100755 --- a/clientbin/sfadump.py +++ b/clientbin/sfadump.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys import os diff --git a/clientbin/sfiAddAttribute.py b/clientbin/sfiAddAttribute.py index de1b8c58..7f336811 100755 --- a/clientbin/sfiAddAttribute.py +++ b/clientbin/sfiAddAttribute.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys diff --git a/clientbin/sfiAddLinks.py b/clientbin/sfiAddLinks.py index 7cd612cb..24284ef7 100755 --- a/clientbin/sfiAddLinks.py +++ b/clientbin/sfiAddLinks.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys diff --git a/clientbin/sfiAddSliver.py b/clientbin/sfiAddSliver.py index 0ae3e84e..72b649b5 100755 --- a/clientbin/sfiAddSliver.py +++ b/clientbin/sfiAddSliver.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys diff --git a/clientbin/sfiDeleteAttribute.py b/clientbin/sfiDeleteAttribute.py index 6794d458..d60de403 100755 --- a/clientbin/sfiDeleteAttribute.py +++ b/clientbin/sfiDeleteAttribute.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys diff --git a/clientbin/sfiDeleteSliver.py b/clientbin/sfiDeleteSliver.py index d3a01122..cc5cf4c3 100755 --- a/clientbin/sfiDeleteSliver.py +++ b/clientbin/sfiDeleteSliver.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys diff --git a/clientbin/sfiListLinks.py b/clientbin/sfiListLinks.py index ed32d24b..140cbb64 100755 --- a/clientbin/sfiListLinks.py +++ b/clientbin/sfiListLinks.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys from sfa.client.sfi_commands import Commands diff --git a/clientbin/sfiListNodes.py b/clientbin/sfiListNodes.py index e115b8fc..81684bf8 100755 --- a/clientbin/sfiListNodes.py +++ b/clientbin/sfiListNodes.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys diff --git a/clientbin/sfiListSlivers.py b/clientbin/sfiListSlivers.py index 934e2935..83edd3cf 100755 --- a/clientbin/sfiListSlivers.py +++ b/clientbin/sfiListSlivers.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys from sfa.client.sfi_commands import Commands diff --git a/sfa/client/sfi_commands.py b/sfa/client/sfi_commands.py index d93b3960..6ba48a80 100755 --- a/sfa/client/sfi_commands.py +++ b/sfa/client/sfi_commands.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#!/usr/bin/env python3 import sys from optparse import OptionParser diff --git a/sfatables/sfatables b/sfatables/sfatables index 6bf4408b..924c9057 100755 --- a/sfatables/sfatables +++ b/sfatables/sfatables @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # This file parses an sfatables command and generates XML files that parameterize # matches and targets. Each such XML file defines a rule. Rules are dropped in directories @@ -42,7 +42,7 @@ def create_parser(command_dict): parser = OptionParser(usage="sfatables [command] [chain] [match] [target]", description='See "man sfatables" for more detail.') - for k in command_dict.keys(): + for k in list(command_dict.keys()): command = command_dict[k] for (short_option,long_option) in command.options: parser.add_option(short_option,long_option,dest=command.type,action=command.action,const=k,help=command.help,metavar="CHAIN") @@ -53,7 +53,7 @@ def create_parser_xml_ext(ext_dict): parser = OptionParser(usage="sfatables [command] [chain] [match] [target]", description='See "man sfatables" for more detail.') - for k in ext_dict.keys(): + for k in list(ext_dict.keys()): command = ext_dict[k] for arg in command.arguments: parser.add_option('',"--"+arg['name'],dest=arg['name'],help=arg['help'],metavar=arg['target']) @@ -91,16 +91,16 @@ def main(): raise Exception("Must specify match for this command") match_dict = load_xml_extensions("sfatables.matches",match_dir) match_parser = create_parser_xml_ext(match_dict) - matches_str = ",".join(match_dict.keys()) + matches_str = ",".join(list(match_dict.keys())) match_parser.add_option('-m','--match',dest='name',help='Match name (one of %s)'%matches_str, metavar = 'MATCH') match_parser.add_option('-n','--negate',dest='negate',help='Negate result',action='store_true') (match_options, args) = match_parser.parse_args(pargs[1]) try: name = match_options.name except Exception: - print "Must specify match name with -m" + print("Must specify match name with -m") - if (match_dict.has_key(name)): + if (name in match_dict): setattr(match_options, 'arguments', match_dict[name].arguments) else: raise Exception('Match %s not found'%name) @@ -113,16 +113,16 @@ def main(): raise Exception("Must specify a target for this command") target_dict = load_xml_extensions("sfatables.targets",target_dir) target_parser = create_parser_xml_ext(target_dict) - targets_str = ",".join(target_dict.keys()) + targets_str = ",".join(list(target_dict.keys())) target_parser.add_option('-j','--jump',dest='name',help='Target name (one of %s)'%targets_str, metavar = 'TARGET') target_parser.add_option('-e','--element',dest='element',help='Element name', metavar = 'ELEMENT') (target_options, args) = target_parser.parse_args(pargs[2]) try: name = target_options.name except Exception: - print "Must specify target name with -j" + print("Must specify target name with -j") - if (target_dict.has_key(name)): + if (name in target_dict): setattr(target_options, 'arguments', target_dict[name].arguments) else: raise Exception('Target %s not found'%name) -- 2.43.0