libstoragemgmt/0001-lsmcli-Fix-required-to-run-on-python3.7.patch
Gris Ge 9b79c712ed Fix lscmli on python 3.7.
Signed-off-by: Gris Ge <fge@redhat.com>
2018-06-26 01:58:29 +08:00

39 lines
1.4 KiB
Diff

From 5715d7c495e4146700b3d1f0f3739b5e970ade68 Mon Sep 17 00:00:00 2001
From: Gris Ge <fge@redhat.com>
Date: Tue, 26 Jun 2018 01:46:39 +0800
Subject: [PATCH] lsmcli: Fix required to run on python3.7
* Python 3.7 introduced new reserved keywords -- `async` which happened
to be used in lsmcli. We change lsmcli to use `_async` instead.
Signed-off-by: Gris Ge <fge@redhat.com>
---
tools/lsmcli/cmdline.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lsmcli/cmdline.py b/tools/lsmcli/cmdline.py
index 664bf0d3..9a8324ad 100644
--- a/tools/lsmcli/cmdline.py
+++ b/tools/lsmcli/cmdline.py
@@ -187,7 +187,7 @@ def _add_common_options(arg_parser, is_child=False):
help='Include the header with terse')
arg_parser.add_argument(
- '-b', action="store_true", dest="%sasync" % prefix, default=False,
+ '-b', action="store_true", dest="%s_async" % prefix, default=False,
help='Run the command async. Instead of waiting for completion.\n '
'Command will exit(7) and job id written to stdout.')
@@ -1459,7 +1459,7 @@ def _wait_for_it(self, msg, job, item):
else:
# If a user doesn't want to wait, return the job id to stdout
# and exit with job in progress
- if self.args.async:
+ if self.args._async:
out(job)
self.shutdown(ErrorNumber.JOB_STARTED)
--
2.18.0