Rework the package upgrade after repos

This moves back the generic upgrade process
for packages after the repos are added back
to the run_tests.sh script.
Instead if solves the known python-chardet
dependency bug for requests package for RPM
packaging in the repos.pp manifest.
This is because we need to fix that bug when
running the beaker tests.
We need to keep an eye out if we see any
similar bugs in the future now that updates
are now executed for all packages in beaker
tests.
Change-Id: If12897355d5a4ba7c05e6ee79d63417fcae03977
This commit is contained in:
Tobias Urdin
2018年09月08日 22:10:53 +02:00
parent ddc4986c60
commit 8dc7b22c35

View File

@@ -15,7 +15,6 @@ class openstack_integration::repos {
release => 'rocky',
package_require => true,
uca_location => pick($::uca_mirror_host, 'http://ubuntu-cloud.archive.canonical.com/ubuntu'),
before => File['/tmp/update-packages'],
}
}
'debian':{
@@ -23,7 +22,6 @@ class openstack_integration::repos {
class { '::openstack_extras::repo::debian::debian':
release => 'queens',
package_require => true,
before => File['/tmp/update-packages'],
}
}
default:{
@@ -37,13 +35,11 @@ class openstack_integration::repos {
apt::pin { 'ceph':
priority => 1001,
originator => "Ceph ${ceph_version_cap}",
before=>File['/tmp/update-packages'],
}
}else{
apt::pin { 'ceph':
priority => 1001,
origin => 'download.ceph.com',
before => File['/tmp/update-packages'],
}
}
$enable_sig=false
@@ -68,7 +64,6 @@ class openstack_integration::repos {
'gpgcheck' => 'no',
},
},
before=>File['/tmp/update-packages'],
}
#TODO(tobasco):RemovethisCBScandidaterepoforMimicwhenStorageSIGreleaseit.
$ceph_mirror_fallback=$ceph_version_real?{
@@ -94,7 +89,6 @@ class openstack_integration::repos {
matches => [ 'fedora*.repo' ],
rmdirs => false,
require => Class['::openstack_extras::repo::redhat::redhat'],
before => File['/tmp/update-packages'],
}
}
}
@@ -107,32 +101,21 @@ class openstack_integration::repos {
enable_sig => $enable_sig,
enable_epel => $enable_epel,
ceph_mirror => $ceph_mirror,
before => File['/tmp/update-packages'],
}
#Wewanttoupgradepackagesafterreposisaddedbutonlyonce
#tonotbreakidempotency.Mustbedoneinheresoitappliesto
#bothintegrationandbeakertests.
#NOTE(tobias-urdin):Thepython-requestsRPMpackagehasapackagedependency
#whichupstreamrequestspackagedoesnotsupportsoitoutputsawarningwhich
#messesupoutput(warningisprintedtostdout)ancausessomeprovidersthat
#relyonthestdoutoutputtofail.Ifyouupgradethepython-chardetdependency
#toanewerversionyouarefine,isreportedupstream:
#https://bugzilla.redhat.com/show_bug.cgi?id=1620221
#Thisisaddedheresowehavethelatestofthispackageinbothintegrationand
#beakertesting.
if$::osfamily=='RedHat'{
if $::operatingsystem == 'Fedora' {
$yum_cmd = '/usr/bin/dnf'
}else{
$yum_cmd = '/usr/bin/yum'
package { 'python-chardet':
ensure => 'latest',
}
$update_cmd="${yum_cmd} update -y"
}else{
$update_cmd = '/usr/bin/apt upgrade -y'
}
file{ '/tmp/update-packages':
ensure => 'present',
notify => Exec['update-packages'],
}
exec{ 'update-packages':
command => $update_cmd,
refreshonly => true,
tries => 2,
timeout => 900,
Yumrepo<||>->Package<|title=='python-chardet'|>
}
}

View File

@@ -204,6 +204,18 @@ if [ "${MANAGE_REPOS}" = true ]; then
print_header 'Puppet failed to install repositories.'
exit 1
fi
print_header 'Updating packages'
if is_fedora; then
$SUDO $YUM update -y
update_ret=$?
elif uses_debs; then
$SUDO apt-get upgrade -y
update_ret=$?
fi
if [ $update_ret -ne 0 ]; then
print_header 'Error updating packages'
exit 1
fi
fi
print_header "Running Puppet Scenario: ${SCENARIO} (1st time)"
Reference in New Issue
openstack/puppet-openstack-integration
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.