~wesley-wiedenmeier/curtin/reporting-cleanup-rebase

  • Committer: Scott Moser
  • Date: 2015-12-17 20:40:48 UTC
  • mfrom: (321.1.1 trunk.nodeps-help)
  • Revision ID: smoser@ubuntu.com-20151217204048-5yupk3xut7prj1qf
fix python executable selection when 'curtin --help' is called

The launcher was passing command arguments through to PY3OR2_MCHECK. If
you ran './curtin --help', then the launcher would call:
  python3 -m $PY3OR2_MCHECK --help
That program would print its help, and exit 0. The launcher would
interpret the exit status of 0 to mean all dependencies were met. If that
was not the case, then it would not look further to test python.

In an environment (trusty) where python2 had deps installed, but python3
did not, the launcher would then invoke 'curtin --help' with python3.
That would then stacktrace on missing dependencies.

The fix here is to pass '--' to separate the arguments to the checker
from the arguments that would be used.

In order to facilitate debugging, if PY3OR2_DEBUG is present, then
we will add '-v' to the invocation, calling:
  python3 -m $PY3OR2_MCHECK -v -- args...

The result is then that:
  PY3OR2_DEBUG=1 ./bin/curtin --help

Will show output like:
  python3 [94]: Fix with:
    apt-get -qy install lvm2 mdadm python3-oauthlib xfsprogs
  current best: python3
  python [94]: Fix with:
    apt-get -qy install lvm2 mdadm python-oauthlib xfsprogs
  executing: python3 -m "curtin.commands.main" --help
Filename Latest Rev Last Changed Committer Comment Size
..
bin 7 11 years ago Scott Moser initial stub multi-command Diff
curtin 7 11 years ago Scott Moser initial stub multi-command Diff
debian 9 11 years ago Scott Moser add initial packaging Diff
doc 2 11 years ago Scott Moser very rough initial doc using sphynx. Diff
examples 45 11 years ago Scott Moser add examples dir Diff
helpers 25 11 years ago Scott Moser block-meta simple now partitions with 'partition' Diff
tests 8 11 years ago Scott Moser make test (with 1 test) Diff
tools 8 11 years ago Scott Moser make test (with 1 test) Diff
.bzrignore 228 9 years ago Scott Moser add tox for easier testing 23 bytes Diff Download File
LICENSE 6 11 years ago Scott Moser add LICENSE file 33.7 KB Diff Download File
Makefile 318.1.1 9 years ago Scott Moser vmtests: invoke nosetests3 with --nologcapture Wh 932 bytes Diff Download File
README 1 11 years ago Scott Moser initial README 163 bytes Diff Download File
requirements.txt 239.1.1 9 years ago Scott Moser initial commit 123 bytes Diff Download File
setup.py 254.1.1 9 years ago Scott Moser add reporter.legacy to modules 768 bytes Diff Download File
test-requirements.txt 228 9 years ago Scott Moser add tox for easier testing 10 bytes Diff Download File
tox.ini 249.1.1 9 years ago Scott Moser add docs rule to Makefile and 'tox -e docs' This 895 bytes Diff Download File