Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix command debug output to join tuples as well. #77

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

pvalena
Copy link
Collaborator

@pvalena pvalena commented Jan 10, 2020

No description provided.

@packit-as-a-service
Copy link

Congratulations! The build has finished successfully. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/psss-tmt-77
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@pvalena
Copy link
Collaborator Author

pvalena commented Jan 10, 2020

diff --git a/tmt/utils.py b/tmt/utils.py
index 44bf197..4fb8687 100644
--- a/tmt/utils.py
+++ b/tmt/utils.py
@@ -170,7 +170,7 @@ class Common(object):

         # Handle the exit code, return output
         if process.returncode != 0:
-            if isinstance(command, list) or isinstance(command, tuple):
+            if isinstance(command, (list, tuple)):
                 command = ' '.join(command)
             raise subprocess.CalledProcessError(process.returncode, command)
         return stdout, stderr
@@ -185,7 +185,10 @@ class Common(object):
         """
         # Use a generic message if none given, prepare error message
         if not message:
-            line = ' '.join(command) if isinstance(command, list) or isinstance(command, tuple) else command
+            if isinstance(command, (list, tuple)):
+                line = ' '.join(command)
+            else:
+                line = command
             message = f"Run command '{line}'."
         self.debug(message)
         message = "Failed to " + message[0].lower() + message[1:]

@psss psss merged commit 04add17 into teemtee:master Jan 13, 2020
@psss psss self-assigned this Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants