[node-patches] Change in ovirt-node[ovirt-3.5]: Allow virt-who-password to be run and keep the key

fabiand at redhat.com fabiand at redhat.com
Tue Sep 15 12:59:59 UTC 2015


Fabian Deutsch has uploaded a new change for review.

Change subject: Allow virt-who-password to be run and keep the key
......................................................................

Allow virt-who-password to be run and keep the key

virt-who and its associated utilities keep using absolute paths
to python files that we strip. Patch yet another file, and persist
the key file it generates so it sticks between reboots

Change-Id: I24002f4298a84f228ca4f9f62590f63bd266e7ba
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1209350
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M recipe/common-post.ks
M recipe/rhevh6-post.ks
M recipe/rhevh7-post.ks
3 files changed, 51 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/78/46178/1

diff --git a/recipe/common-post.ks b/recipe/common-post.ks
index fcbd217..d41dd17 100644
--- a/recipe/common-post.ks
+++ b/recipe/common-post.ks
@@ -108,6 +108,7 @@
 files	/var/cache/libvirt
 files	/var/empty/sshd/etc/localtime
 files	/var/lib/libvirt
+files   /var/lib/virt-who
 files   /var/lib/multipath
 files   /var/cache/multipathd
 empty	/mnt
diff --git a/recipe/rhevh6-post.ks b/recipe/rhevh6-post.ks
index 4f89b7f..6dbd261 100644
--- a/recipe/rhevh6-post.ks
+++ b/recipe/rhevh6-post.ks
@@ -194,6 +194,31 @@
     chmod a+x /usr/bin/virt-who
 fi
 
+# rhbz 1209350 virt-who keeps using absolute paths to uncompiled
+# python files. Change this to the compiled version as well, and
+# persist the generated key file
+
+patch -d /bin -p0 << \EOF_virt_who_password
+--- virt-who-password      2015-04-07 12:13:41.992000000 -0400
++++ virt-who-password       2015-04-07 12:14:33.909000000 -0400
+@@ -1,10 +1,12 @@
+ #!/bin/sh
+
+-if [ -f ./virtwhopassword.py ];
++if [ -f ./virtwhopassword.pyc ];
+ then
+     # Run it from local directory when available
+-    exec /usr/bin/python ./virtwhopassword.py "$@"
++    /usr/bin/python ./virtwhopassword.pyc "$@"
+ else
+     # Run it from /usr/share/virt-who
+-    exec /usr/bin/python /usr/share/virt-who/virtwhopassword.py "$@"
++    /usr/bin/python /usr/share/virt-who/virtwhopassword.pyc "$@"
+ fi
++
++persist /var/lib/virt-who/key
+EOF_virt_who_password
+
 # set maxlogins to 3
 echo "*        -       maxlogins      3" >> /etc/security/limits.conf
 
diff --git a/recipe/rhevh7-post.ks b/recipe/rhevh7-post.ks
index f073b9a..7a97636 100644
--- a/recipe/rhevh7-post.ks
+++ b/recipe/rhevh7-post.ks
@@ -195,6 +195,31 @@
 EOF_virt_who
 fi
 
+# rhbz 1209350 virt-who keeps using absolute paths to uncompiled
+# python files. Change this to the compiled version as well, and
+# persist the generated key file
+
+patch -d /bin -p0 << \EOF_virt_who_password
+--- virt-who-password      2015-04-07 12:13:41.992000000 -0400
++++ virt-who-password       2015-04-07 12:14:33.909000000 -0400
+@@ -1,10 +1,12 @@
+ #!/bin/sh
+
+-if [ -f ./virtwhopassword.py ];
++if [ -f ./virtwhopassword.pyc ];
+ then
+     # Run it from local directory when available
+-    exec /usr/bin/python ./virtwhopassword.py "$@"
++    /usr/bin/python ./virtwhopassword.pyc "$@"
+ else
+     # Run it from /usr/share/virt-who
+-    exec /usr/bin/python /usr/share/virt-who/virtwhopassword.py "$@"
++    /usr/bin/python /usr/share/virt-who/virtwhopassword.pyc "$@"
+ fi
++
++persist /var/lib/virt-who/key
+EOF_virt_who_password
+
 # rhbz 1152947 fixing virt-who start dependancy syslog.socket
 # first of all fixing the missing link of syslog to rsyslog
 # depending service and socket for correct operation


-- 
To view, visit https://gerrit.ovirt.org/46178
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I24002f4298a84f228ca4f9f62590f63bd266e7ba
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list