diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-08-19 13:28:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-08-19 13:28:55 +0000 |
| commit | 24c55ff7897eec9505e48a30d73783ae76e45e29 (patch) | |
| tree | edf57e3540e73556d361d538a543b1a0d3a9d36a /docker/macros.j2 | |
| parent | cafe368a727d979af6e5fb88fc6c673e3dab0b72 (diff) | |
| parent | a9d08726f5a48eef77c04ea1acefc00d93ce7076 (diff) | |
| download | kolla-24c55ff7897eec9505e48a30d73783ae76e45e29.tar.gz kolla-24c55ff7897eec9505e48a30d73783ae76e45e29.zip | |
Merge "Handle empty package list for install_packages"
Diffstat (limited to 'docker/macros.j2')
| -rw-r--r-- | docker/macros.j2 | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/docker/macros.j2 b/docker/macros.j2 index 5cdb12b4c..494feb2f4 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -1,12 +1,14 @@ {% macro install_packages(packages) -%} -{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] -%} - yum -y install {{ packages | join(' ') }} && yum clean all -{%- elif base_distro in ['ubuntu', 'debian'] -%} - {#- - debian_package_install is a utility method to build up an appropriate - set of commands to install packages in a debian-based environment that - may include URL links to a .deb package (e.g, heka) - -#} - {{ debian_package_install(packages) }} +{% if packages is defined and packages|length > 0 -%} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] -%} + RUN yum -y install {{ packages | join(' ') }} && yum clean all + {%- elif base_distro in ['ubuntu', 'debian'] -%} + {#- + debian_package_install is a utility method to build up an appropriate + set of commands to install packages in a debian-based environment that + may include URL links to a .deb package (e.g, heka) + -#} + RUN {{ debian_package_install(packages) }} + {%- endif %} {%- endif %} {%- endmacro %} |
