Merge "Allow package-installs to parse DIB_PYTHON_VERSION"

This commit is contained in:
Jenkins 2016-12-14 02:23:47 +00:00 committed by Gerrit Code Review
commit 8565867734
2 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,10 @@ example ``package-installs.yaml``
not-arch: ppc64, ppc64le
lshw:
arch: ppc64, ppc64le
python-dev:
dib_python_version: 2
python3-dev:
dib_python_version: 3
example package-installs.json
@ -46,6 +50,7 @@ the following default values::
uninstall: False
installtype: * (Install package for all installtypes)
arch: * (Install package for all architectures)
dib_python_version: (2 or 3 depending on DIB_PYTHON_VERSION, see dib-python)
Setting the installtype property causes the package only to be installed if
the specified installtype would be used for the element. See the

View File

@ -75,8 +75,12 @@ def collect_data(data, filename, element_name):
installtype == elem_installtype)
valid_arch = _valid_for_arch(pkg_name, params.get('arch', None),
params.get('not-arch', None))
dib_py_version = str(params.get('dib_python_version', ''))
dib_py_version_env = os.environ.get('DIB_PYTHON_VERSION', '')
valid_dib_python_version = (dib_py_version == '' or
dib_py_version == dib_py_version_env)
if valid_installtype and valid_arch:
if valid_installtype and valid_arch and valid_dib_python_version:
data[phase][install].append((pkg_name, element_name))
return data