Skip to content

Commit

Permalink
Closes-Bug: #1610074
Browse files Browse the repository at this point in the history
renamed rpm package could have been used to add image to SM. Extract
package name from package itself instead of package filename.

Change-Id: I6ea449bd6952dcc454d893216182997c56dbe70d
  • Loading branch information
kamleshp committed Aug 8, 2016
1 parent a1994bf commit 977cb82
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 977cb82

Please sign in to comment.