aboutsummaryrefslogtreecommitdiffstats
path: root/vnfsdk_pkgtools/packager/utils.py
diff options
context:
space:
mode:
authorLianhao Lu <lianhao.lu@intel.com>2019-11-29 14:49:50 +0800
committerLianhao Lu <lianhao.lu@intel.com>2019-11-29 14:50:21 +0800
commitfb75c2fc16491340e32cebf36a361f3e36b2b901 (patch)
treec918b145bc613b6809183f28e8a9867034781435 /vnfsdk_pkgtools/packager/utils.py
parent8767846c931ee9cef818ced06f790dabeae535ca (diff)
Fix pep8 error and warnings
Change-Id: Ic32eefcfd4be4d57c9cf30eff0b3fa1aa730d2c0 Issue-ID: VNFSDK-532 Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Diffstat (limited to 'vnfsdk_pkgtools/packager/utils.py')
-rw-r--r--vnfsdk_pkgtools/packager/utils.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/vnfsdk_pkgtools/packager/utils.py b/vnfsdk_pkgtools/packager/utils.py
index 539a242..5624287 100644
--- a/vnfsdk_pkgtools/packager/utils.py
+++ b/vnfsdk_pkgtools/packager/utils.py
@@ -75,7 +75,7 @@ def cal_file_hash(root, path, algo):
def _run_cmd(cmd, **kwargs):
if isinstance(cmd, list):
args = cmd
- elif isinstance(cmd, string):
+ elif isinstance(cmd, str):
args = [cmd]
else:
raise RuntimeError("cmd must be string or list")
@@ -96,11 +96,10 @@ def _run_cmd(cmd, **kwargs):
def sign(msg_file, cert_file, key_file):
args = ["openssl", "cms", "-sign", "-binary"]
kwargs = {
- '-in': os.path.abspath(msg_file),
- '-signer': os.path.abspath(cert_file),
- '-inkey': os.path.abspath(key_file),
- '-outform': 'PEM',
- }
+ '-in': os.path.abspath(msg_file),
+ '-signer': os.path.abspath(cert_file),
+ '-inkey': os.path.abspath(key_file),
+ '-outform': 'PEM', }
return _run_cmd(args, **kwargs)
@@ -114,9 +113,8 @@ def verify(msg_file, cert_file, cms, no_verify_cert=False):
f.write(cms)
f.flush()
kwargs = {
- '-in': f.name,
- '-inform': 'PEM',
- '-content': os.path.abspath(msg_file),
- '-certfile': os.path.abspath(cert_file),
- }
+ '-in': f.name,
+ '-inform': 'PEM',
+ '-content': os.path.abspath(msg_file),
+ '-certfile': os.path.abspath(cert_file), }
return _run_cmd(args, **kwargs)