mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #9289 from techhat/issue9270
Add additional python 2.6 checks
This commit is contained in:
commit
46d256d205
@ -536,8 +536,9 @@ def _parse_conf(conf_file=None, in_mem=False):
|
||||
parsed_args = vars(parser.parse_args(shlex.split(line)))
|
||||
ret_args = {}
|
||||
chain = parsed_args['append']
|
||||
if isinstance(chain, list):
|
||||
chain = chain[0]
|
||||
if not sys.version.startswith('2.6'):
|
||||
if isinstance(chain, list):
|
||||
chain = chain[0]
|
||||
for arg in parsed_args:
|
||||
if parsed_args[arg] and arg is not 'append':
|
||||
ret_args[arg] = parsed_args[arg]
|
||||
@ -565,7 +566,10 @@ def _parser():
|
||||
add_arg = parser.add_argument
|
||||
|
||||
# COMMANDS
|
||||
add_arg('-A', '--append', dest='append', action='append', nargs='*')
|
||||
if sys.version.startswith('2.6'):
|
||||
add_arg('-A', '--append', dest='append', action='append')
|
||||
else:
|
||||
add_arg('-A', '--append', dest='append', action='append', nargs='*')
|
||||
add_arg('-D', '--delete', dest='delete', action='append')
|
||||
add_arg('-I', '--insert', dest='insert', action='append')
|
||||
add_arg('-R', '--replace', dest='replace', action='append')
|
||||
@ -579,8 +583,13 @@ def _parser():
|
||||
|
||||
# PARAMETERS
|
||||
add_arg('-p', '--protocol', dest='protocol', action='append')
|
||||
add_arg('-s', '--source', dest='source', action='append', nargs='*')
|
||||
add_arg('-d', '--destination', dest='destination', action='append', nargs='*')
|
||||
if sys.version.startswith('2.6'):
|
||||
add_arg('-s', '--source', dest='source', action='append')
|
||||
add_arg('-d', '--destination', dest='destination', action='append')
|
||||
else:
|
||||
add_arg('-s', '--source', dest='source', action='append', nargs='*')
|
||||
add_arg('-d', '--destination', dest='destination', action='append',
|
||||
nargs='*')
|
||||
add_arg('-j', '--jump', dest='jump', action='append')
|
||||
add_arg('-g', '--goto', dest='goto', action='append')
|
||||
add_arg('-i', '--in-interface', dest='in-interface', action='append')
|
||||
|
Loading…
Reference in New Issue
Block a user