Skip to content

Commit

Permalink
qvm-template: Fix compatibility with Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyPillow committed Sep 6, 2020
1 parent 3fac209 commit 554459e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qubesadmin/tools/qvm_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def parser_gen() -> argparse.ArgumentParser:
formatter = argparse.ArgumentDefaultsHelpFormatter
parser_main = argparse.ArgumentParser(description='Qubes Template Manager',
formatter_class=formatter)
subparsers = parser_main.add_subparsers(dest='operation', required=True,
subparsers = parser_main.add_subparsers(dest='operation',
description='Command to run.')

def parser_add_command(cmd, help_str):
Expand Down Expand Up @@ -1367,6 +1367,9 @@ def main(args: typing.Optional[typing.Sequence[str]] = None,
"""
p_args = parser.parse_args(args)

if not p_args.operation:
parser.error('An operation needs to be specified.')

# If the user specified other repo files...
if len(p_args.repo_files) > 1:
# ...remove the default entry
Expand Down

0 comments on commit 554459e

Please sign in to comment.