Debian Jessie/Python 3.4 support for the most part (#6)

* automatically find the chroot binary on Debian, even if it is not
  in the user's PATH
* don't use subprocess.run anymore (remove related testcase, that explicitly
  checked for subprocess.run usage, and used recursive globbing, another
  post 3.4 Python feature, for the checks. A similar case can be added in the
  future, but right now it's more important to get Debian 3.4 working and all
  PRs are reviewed anyway.)
* pytest fixtures: don't use the newer "yield" feature, as this is only
  supported in a newer version of pytest, than provided on Debian Jessie

From manually testing, most stuff works in Debian Jessie. However, the
testsuite does not run through - creating an empty .tar.gz with Python
fails for some reason (this is done in test_apk_static.py).
This commit is contained in:
Oliver Smith 2017-05-29 20:38:11 +02:00
parent 3eafc5eb8a
commit 3b5d5d8086
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
10 changed files with 30 additions and 58 deletions

View file

@ -32,20 +32,22 @@ def core(args, cmd, log_message, log, return_stdout, check=True):
ret = None
if log:
if return_stdout:
ret = subprocess.run(cmd, stdout=subprocess.PIPE,
check=check).stdout.decode('utf-8')
ret = subprocess.check_output(cmd).decode("utf-8")
args.logfd.write(ret)
else:
subprocess.run(cmd, stdout=args.logfd, stderr=args.logfd,
check=check)
subprocess.check_call(cmd, stdout=args.logfd,
stderr=args.logfd)
args.logfd.flush()
else:
logging.debug("*** output passed to pmbootstrap stdout, not" +
" to this log ***")
subprocess.run(cmd, check=check)
subprocess.check_call(cmd)
except subprocess.CalledProcessError as exc:
raise RuntimeError("Command failed: " + log_message) from exc
if check:
raise RuntimeError("Command failed: " + log_message) from exc
else:
pass
return ret