Skip to content

Commit

Permalink
Closes-Bug: #1558719 - Compute Reboot was not being triggered for 3.0…
Browse files Browse the repository at this point in the history
…->3.0 upgrade

Fix:
Changed contrail-version fact to check for contrail-lib package instead of contrail-install-packages
Beacuse 3.0 release code will run contrail_upgrade in fresh install, need to have different check for 3.0 onwards (check and unless for exec changed)
Check for upgrade_needed was wrong (this is why contrail_upgrade was triggered for fresh install in 3.0 2723)

Patch 2:
Added back $needed_version check in if clause

Change-Id: Iab774b345a87b9d0f191acbabbc8c12430a750b4
  • Loading branch information
nitishkrishna committed Mar 18, 2016
1 parent cf7fb1c commit f127fcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -35,7 +35,7 @@
end
Facter.add(:contrail_version) do
setcode do
Facter::Util::Resolution.exec('dpkg -l contrail-install-packages | grep contrail-install-packages | awk \'{ printf $3}\'')
Facter::Util::Resolution.exec('dpkg -l contrail-lib | grep contrail-lib | awk \'{ printf $3}\'')
end
end
Facter.add(:conductor_idx) do
Expand Down
Expand Up @@ -9,7 +9,7 @@
$needed_version = $::contrail::params::contrail_version
# needed_version is not available om old SMs
notify {"*** installed_version => $::contrail_version ***":;}
if $needed_version and (versioncmp($needed_version, $::contrail_version) > 0) {
if $needed_version and $::contrail_version and (versioncmp($needed_version, $::contrail_version) > 0) {
notify {"*** need => $::needed_version ***":;}
$upgrade_needed = 1
} else {
Expand Down Expand Up @@ -44,8 +44,8 @@
logoutput => $contrail_logoutput,
} ->
exec { 'clear_out_files' :
command => 'rm -f /etc/contrail/contrail*.out && rm -f /opt/contrail/contrail_packages/exec-contrail-setup-sh.out && echo reset_provision >> /etc/contrail/contrail_common_exec.out',
unless => 'grep -qx reset_provision /etc/contrail/contrail_common_exec.out',
command => 'rm -f /etc/contrail/contrail*.out && rm -f /opt/contrail/contrail_packages/exec-contrail-setup-sh.out && echo reset_provision_3_0 >> /etc/contrail/contrail_common_exec.out',
unless => 'grep -qx reset_provision_3_0 /etc/contrail/contrail_common_exec.out',
provider => shell,
logoutput => $contrail_logoutput
}
Expand Down

0 comments on commit f127fcd

Please sign in to comment.