Found with pylint. Construction which used variable input_file was moved after the
input_file was assigned.
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
lnst/Common/Utils.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index fb9d9a2..210dbeb 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -112,13 +112,13 @@ def create_tar_archive(input_path, target_path, compression=False):
else:
args = "cf"
- if os.path.isdir(target_path):
- target_path += "/%s.tar.bz" %
os.path.basename(input_file.rstrip("/"))
-
input_path = input_path.rstrip("/")
input_file = os.path.basename(input_path)
parent = os.path.dirname(input_path)
+ if os.path.isdir(target_path):
+ target_path += "/%s.tar.bz" %
os.path.basename(input_file.rstrip("/"))
+
exec_cmd("cd \"%s\" && tar %s \"%s\"
\"%s\"" % \
(parent, args, target_path, input_file))
--
2.1.0