[node-patches] Change in ovirt-node[master]: edit-node: shown correct info for files ovirt-node-plugin-xx...

hadong0720 at gmail.com hadong0720 at gmail.com
Sun Jun 23 07:10:40 UTC 2013


hadong has uploaded a new change for review.

Change subject: edit-node: shown correct info for files ovirt-node-plugin-xxx and delta-manifest-rpm/srpm/file.txt
......................................................................

edit-node: shown correct info for files ovirt-node-plugin-xxx
and delta-manifest-rpm/srpm/file.txt

Previously after install some plugin, shown error info for file
"ovirt-node-plugin-xxx" and null info for these files "delta-manifest
-rpm/srpm/file.txt"
Now shown correct info for them.

Change-Id: I4b23ef7bd3dd0af29ed4e39f02a614571edf3039
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=977065
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M tools/edit-node
1 file changed, 20 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/90/15990/1

diff --git a/tools/edit-node b/tools/edit-node
index 89fa92e..c3b6bf0 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -754,21 +754,20 @@
             pkg = "password-set"
         print "Creating Manifests"
         # Create post-image processing manifests
-        cmd = "LC_ALL=C rpm -qa --qf '%%{name}-%%{version}-%%{release}.'" + \
-              "'%%{arch} (%%{SIGPGP:pgpsig})\n' | sort -u > " + \
-              "/manifest-%s-rpm.txt" % pkg
+        cmd = "LC_ALL=C rpm -qa --qf '%{name}-%{version}-%{release}." \
+              "%{arch} (%{SIGPGP:pgpsig})\n' | sort -u > " \
+              "/manifest-rpm.txt"
         f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
                              preexec_fn=self._chroot)
         output, err = f.communicate()
-
-        cmd = "LC_ALL=C rpm -qa --qf '%%{sourcerpm}\n' | sort -u > " + \
+        cmd = "LC_ALL=C rpm -qa --qf '%{sourcerpm}\n' | sort -u > " \
               "/manifest-srpm.txt"
         f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
                              preexec_fn=self._chroot)
         output, err = f.communicate()
 
         # collect all included licenses rhbz#601927
-        cmd = "LC_ALL=C rpm -qa --qf '%%{license}\n' | sort -u > " + \
+        cmd = "LC_ALL=C rpm -qa --qf '%{license}\n' | sort -u > " \
               "/manifest-license.txt"
         f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
                              preexec_fn=self._chroot)
@@ -788,13 +787,16 @@
         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)$", "", pkg)
             # get version-release
-            cmd = "rpm -q %s --qf '%%{version}-%%{release}.%%{arch}\n'" % pkg
+            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'" % pkg
+            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()
@@ -826,21 +828,22 @@
             if os.path.exists("%s/iso/isolinux/current-manifest-%s.txt"
                               % (self._ImageCreator__builddir, i)):
                 cmd = "cp %s/iso/isolinux/current-manifest-%s.txt %s/" \
-                      "manifest-%s.txt" % (self._ImageCreator__builddir,
-                                           i,
-                                           self._instroot,
-                                           i)
+                      "current-manifest-%s.txt" \
+                    % (self._ImageCreator__builddir,
+                       i,
+                       self._instroot,
+                       i)
                 f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
                                      stderr=STDOUT)
                 output, err = f.communicate()
             else:
                 cmd = "bzcat %s/iso/isolinux/manifest-%s.txt.bz2|sort > " \
-                    "%s/manifest-%s.txt" % \
+                    "%s/current-manifest-%s.txt" % \
                     (self._ImageCreator__builddir, i, self._instroot, i)
                 f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
                                      stderr=STDOUT)
                 output, err = f.communicate()
-            cmd = "diff -u /manifest-%s.txt /manifest-%s.txt | egrep" \
+            cmd = "diff -u /current-manifest-%s.txt /manifest-%s.txt | egrep" \
                 " -v \"^@|^ \"> /delta-manifest-%s.txt" % \
                 (i, i, i)
             f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,
@@ -850,19 +853,19 @@
             if os.path.exists("%s/iso/isolinux/current-manifest-%s.txt" %
                              (self._ImageCreator__builddir, i)):
                 cmd = "cat %s/iso/isolinux/current-manifest-%s.txt|sort -u " \
-                    "> %s/manifest-%s.txt" % \
+                    "> %s/current-manifest-%s.txt" % \
                     (self._ImageCreator__builddir, i, self._instroot, i)
                 f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
                                      stderr=STDOUT)
                 output, err = f.communicate()
             else:
                 cmd = "cat %s/iso/isolinux/manifest-%s.txt|sort -u >" \
-                      " %s/manifest-%s.txt" % \
+                      " %s/current-manifest-%s.txt" % \
                       (self._ImageCreator__builddir, i, self._instroot, i)
                 f = subprocess.Popen(cmd, shell=True, stdout=PIPE,
                                      stderr=STDOUT)
                 output, err = f.communicate()
-            cmd = "diff -u /manifest-%s.txt /manifest-%s.txt |egrep " \
+            cmd = "diff -u /current-manifest-%s.txt /manifest-%s.txt |egrep " \
                 "-v \"^@|^ \" > /delta-manifest-%s.txt" % \
                 (i, i, i)
             f = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT,


-- 
To view, visit http://gerrit.ovirt.org/15990
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b23ef7bd3dd0af29ed4e39f02a614571edf3039
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