Skip to content

Commit

Permalink
Closes-Bug: #1565038 - SM Contrail Re-provision should not trigger up…
Browse files Browse the repository at this point in the history
…grade

A previous bug fix has exposed a bug where re-provision is now triggering contrail_upgrade manifest.
This happened because version was calculated with sku during add image but without sku when calculating custom fact
The sku has been dropped from the version in image_params['version']

Eg: 3.0.1.0-24~kilo is now just 3.0.1.0-24

This value is sent in hieradata as contrail::params::contrail_version

Change-Id: I3d42ce58e37003540a21ddf2b87975f8a3e17203
  • Loading branch information
nitishkrishna committed Apr 6, 2016
1 parent 37423a4 commit 0197170
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/server_mgr_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1425,15 +1425,17 @@ def put_image(self):
version = subprocess.check_output(['dpkg-deb', '-f',tmp_pkg.strip(),'Version'])
else:
version = subprocess.check_output(['dpkg-deb', '-f',image_path,'Version'])
image_params['version'] = version.strip('\n')
version = version.strip('\n')
image_params['version'] = version.split('~')[0]
#find sku of package (juno/kilo/liberty)
package_sku = self.find_package_sku(image_id)
image_params['sku'] = package_sku
elif image_type == "contrail-storage-ubuntu-package":
self._create_repo(
image_id, image_type, image_version, image_path)
version = subprocess.check_output(['dpkg-deb', '-f',image_path,'Version'])
image_params['version'] = version.strip('\n')
version = version.strip('\n')
image_params['version'] = version.split('~')[0]
else:
image_kickstart = image_params.get('kickstart', '')
image_kickseed = image_params.get('kickseed', '')
Expand Down Expand Up @@ -1800,14 +1802,16 @@ def upload_image(self):
version = package_name[match_index:-4]
else:
version = subprocess.check_output(['dpkg-deb', '-f',dest,'Version'])
image_params['version'] = version.strip('\n')
version = version.strip('\n')
image_params['version'] = version.split('~')[0]
package_sku = self.find_package_sku(image_id)
image_params['sku'] = package_sku
elif image_type == "contrail-storage-ubuntu-package":
self._create_repo(
image_id, image_type, image_version, dest)
version = subprocess.check_output(['dpkg-deb', '-f',dest,'Version'])
image_params['version'] = version.strip('\n')
version = version.strip('\n')
image_params['version'] = version.split('~')[0]
else:
kickstart_obj = bottle.request.files.get('kickstart', None)
kickstart_dest = kickseed_dest = ''
Expand Down

0 comments on commit 0197170

Please sign in to comment.