Merge "always update APT lists when install packages"

This commit is contained in:
Jenkins 2017-05-10 11:09:58 +00:00 committed by Gerrit Code Review
commit e4fa287158
3 changed files with 4 additions and 4 deletions

View File

@ -24,8 +24,7 @@ COPY {{ opendaylight_repo }} /etc/yum.repos.d/
{% set odl_release_deb_url = 'http://download.opensuse.org/repositories/home:/akshitajha/Debian_8.0/' %}
{% endif %}
{% endif %}
RUN sh -c "echo 'deb {{ odl_release_deb_url }} /' > /etc/apt/sources.list.d/opendaylight.list" \
&& apt-get update
RUN sh -c "echo 'deb {{ odl_release_deb_url }} /' > /etc/apt/sources.list.d/opendaylight.list"
{% endif %}
{{ macros.install_packages(opendaylight_packages | customizable("packages")) }}

View File

@ -44,6 +44,7 @@ def debian_package_install(packages):
# handle the apt-get install
if reg_packages:
cmds.append('apt-get update')
cmds.append('apt-get -y install --no-install-recommends {}'.format(
' '.join(reg_packages)
))

View File

@ -20,4 +20,4 @@ class MethodsTest(base.TestCase):
packages = ['https://packages.debian.org/package1.deb', 'package2.deb']
result = methods.debian_package_install(packages)
expectCmd = 'apt-get -y install --no-install-recommends package2.deb'
self.assertEqual(expectCmd, result.split("&&")[0])
self.assertEqual(expectCmd, result.split("&&")[1].strip())