Skip to content

Commit

Permalink
Merge "Closes-Bug: #1610074 renamed rpm package could have been used …
Browse files Browse the repository at this point in the history
…to add image to SM. Extract package name from package itself instead of package filename."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 9, 2016
2 parents 0b65cb0 + 9939ad0 commit 2aa9eb9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server_mgr_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,10 @@ def put_image(self):
version = ver + "-"+ release.split('.')[0]
elif output and 'RPM' in output:
sm = ServerMgrUtil()
version = sm.get_package_version(os.path.basename(image_path))
# package could have been renamed, extract package name using rpm
cmd = "rpm -qp %s" %image_path.strip()
pkg_name = subprocess.check_output(cmd, shell = True)
version = sm.get_package_version(pkg_name)
else:
version = subprocess.check_output(['dpkg-deb', '-f',image_path,'Version'])
version = version.strip('\n')
Expand Down

0 comments on commit 2aa9eb9

Please sign in to comment.