#6 Backport function tests from centos stream
Merged 3 months ago by mcsontos. Opened 3 months ago by fsuba.
rpms/ fsuba/device-mapper-persistent-data rawhide  into  rawhide

@@ -72,4 +72,4 @@ 

  	@echo "RunFor:       $(PACKAGE_NAME)" >> $(METADATA)

  	@echo "Requires:     $(PACKAGE_NAME)" >> $(METADATA)

  

- 	rhts-lint $(METADATA) 

\ No newline at end of file

+ 	rhts-lint $(METADATA)

@@ -16,6 +16,8 @@ 

  

  """dmpd_library.py: Complete library providing functionality for device-mapper-persistent-data upstream test."""

  

+ from __future__ import print_function

+ 

  import platform

  from os.path import expanduser

  import re #regex
@@ -25,7 +27,6 @@ 

  import fileinput

  # TODO: Is this really necessary? Unlikely we will run into python2 in rawhide

  # again...

- from __future__ import print_function

  

  

  def _print(string):
@@ -55,7 +56,7 @@ 

          date = "date \"+%Y-%m-%d %H:%M:%S\""

          p = subprocess.Popen(date, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)

          stdout, stderr = p.communicate()

-         stdout = stdout.rstrip("\n")

+         stdout = stdout.decode('ascii', 'ignore').rstrip("\n")

          _print("INFO: [%s] Running: '%s'..." % (stdout, cmd))

  

      #enabling shell=True, because was the only way I found to run command with '|'
@@ -77,7 +78,7 @@ 

  

      retcode = p.returncode

  

-     output = stdout + stderr

+     output = stdout.decode('ascii', 'ignore') + stderr.decode('ascii', 'ignore')

  

      #remove new line from last line

      output = output.rstrip()

no initial comment

Pull-Request has been merged by mcsontos

3 months ago