Skip to content

Commit

Permalink
Fix test export into nitrate on rhel-8 [fix #337]
Browse files Browse the repository at this point in the history
Do not use capture_output as it is a Python 3.7+ feature.
Use dict_to_yaml() to prevent the one-line json fmf id.
  • Loading branch information
psss committed Sep 2, 2020
1 parent 9f5e077 commit 5a32b2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tmt/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def fmf_id(self):

def run(command):
""" Run command, return output """
result = subprocess.run(command.split(), capture_output=True)
result = subprocess.run(command.split(), stdout=subprocess.PIPE)
return result.stdout.strip().decode("utf-8")

fmf_id = {'name': self.name}
Expand Down
6 changes: 3 additions & 3 deletions tmt/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ def export_to_nitrate(test, create, general):
echo(style(section + ': ', fg='green') + attribute.strip())

# fmf identifer
fmf_id = test.fmf_id
struct_field.set('fmf', yaml.dump(fmf_id))
echo(style('fmf id:\n', fg='green') + yaml.dump(fmf_id).strip())
fmf_id = tmt.utils.dict_to_yaml(test.fmf_id)
struct_field.set('fmf', fmf_id)
echo(style('fmf id:\n', fg='green') + fmf_id.strip())

# Warning
if WARNING not in struct_field.header():
Expand Down

0 comments on commit 5a32b2f

Please sign in to comment.