[node-patches] Change in ovirt-node[master]: Fix plugin info shown incorrectly issue when install multipl...
hadong0720 at gmail.com
hadong0720 at gmail.com
Wed Nov 6 10:09:19 UTC 2013
hadong has uploaded a new change for review.
Change subject: Fix plugin info shown incorrectly issue when install multiple packages
......................................................................
Fix plugin info shown incorrectly issue when install multiple packages
Change-Id: I8d74b305411a2aa9128e4b589e41e69965bc1e7b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1027161
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M tools/edit-node
1 file changed, 26 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/57/20957/1
diff --git a/tools/edit-node b/tools/edit-node
index fce5a52..5dc1c29 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -802,31 +802,32 @@
if options.install or options.plugin or options.install_dup:
plugin_info_dir = "%s/etc/ovirt-plugins.d" % self._instroot
os.system("mkdir -p %s" % plugin_info_dir)
- pkgfilename = re.sub("\.(rpm)$", "", os.path.basename(pkg))
- # get version-release
- cmd = "rpm -q %s --qf '%%{version}-%%{release}.%%{arch}\n'" \
- % pkgfilename
- f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
- preexec_fn=self._chroot)
- vr, err = f.communicate()
- # get install date
- cmd = "LC_ALL=C rpm -q %s --qf '%%{INSTALLTIME:date}\n'" \
- % pkgfilename
- f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
- preexec_fn=self._chroot)
- install_date, err = f.communicate()
- if os.path.isfile(pkg):
- #get rpm name
- cmd = "rpm -qp %s --qf '%%{name}'" % pkg
- f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
- stderr=STDOUT)
- pkg, err = f.communicate()
- plugin_file = "%s/%s" % (plugin_info_dir, pkg)
- pfile = open(plugin_file, "w")
- pfile.write("Name:%s\n" % pkg)
- pfile.write("Version:%s-%s" % (pkg, vr))
- pfile.write("Install Date:%s" % install_date)
- pfile.close()
+ for pkg in pkg.split(","):
+ pkgfilename = re.sub("\.(rpm)$", "", os.path.basename(pkg))
+ # get version-release
+ cmd = "rpm -q %s --qf '%%{version}-%%{release}.%%{arch}\n'" \
+ % pkgfilename
+ f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
+ preexec_fn=self._chroot)
+ vr, err = f.communicate()
+ # get install date
+ cmd = "LC_ALL=C rpm -q %s --qf '%%{INSTALLTIME:date}\n'" \
+ % pkgfilename
+ f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
+ preexec_fn=self._chroot)
+ install_date, err = f.communicate()
+ if os.path.isfile(pkg):
+ #get rpm name
+ cmd = "rpm -qp %s --qf '%%{name}'" % pkg
+ f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
+ stderr=STDOUT)
+ pkg, err = f.communicate()
+ plugin_file = "%s/%s" % (plugin_info_dir, pkg)
+ pfile = open(plugin_file, "w")
+ pfile.write("Name:%s\n" % pkg)
+ pfile.write("Version:%s-%s" % (pkg, vr))
+ pfile.write("Install Date:%s" % install_date)
+ pfile.close()
update_dir_list = glob.glob(os.path.join(self._ImageCreator__builddir,
"iso", "isolinux", "update*"))
--
To view, visit http://gerrit.ovirt.org/20957
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d74b305411a2aa9128e4b589e41e69965bc1e7b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>
More information about the node-patches
mailing list