Ryan Barry has uploaded a new change for review. Change subject: Make virt-who work again ......................................................................
Make virt-who work again The virt-who developers changed the structure of the package a bit and we need to tweak a bit to account. Also, futureproof EL7 a little since this change will probably land there as well Change-Id: I6955630310ed9b6f23336c21014ebcafce88f0f2 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1152414 Signed-off-by: Ryan Barry <[email protected]> --- M recipe/rhevh6-post.ks M recipe/rhevh7-post.ks 2 files changed, 30 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/43/34943/1 diff --git a/recipe/rhevh6-post.ks b/recipe/rhevh6-post.ks index eab0fae..fd7d3f7 100644 --- a/recipe/rhevh6-post.ks +++ b/recipe/rhevh6-post.ks @@ -146,10 +146,21 @@ # rhbz#734478 add virt-who (*.py are removed in rhevh image) if [ -f /etc/rhev-hypervisor-release ]; then - cat > /usr/bin/virt-who <<EOF_virt_who - #!/bin/sh - exec /usr/bin/python /usr/share/virt-who/virt-who.pyc "\$@" + cmd_who="" + if [ -f /usr/share/virt-who/virt-who.pyc ]; then + cmd_who="virt-who.pyc" + elif [ -f /usr/share/virt-who/virtwho.pyc ]; then + cmd_who="virtwho.pyc" + else + echo "Couldn't find a known virt-who executable. Please check" + fi + + if [ ! -z $cmd_who ]; then + cat > /usr/bin/virt-who <<EOF_virt_who + #!/bin/sh + exec /usr/bin/python /usr/share/virt-who/$cmd_who "\$@" EOF_virt_who + fi fi # set maxlogins to 3 diff --git a/recipe/rhevh7-post.ks b/recipe/rhevh7-post.ks index c9a07af..16eee10 100644 --- a/recipe/rhevh7-post.ks +++ b/recipe/rhevh7-post.ks @@ -130,10 +130,23 @@ echo "files /var/lib/nfs" >> /etc/rwtab # rhbz#734478 add virt-who (*.py are removed in rhevh image) -cat > /usr/bin/virt-who <<EOF_virt_who -#!/bin/sh -exec /usr/bin/python /usr/share/virt-who/virt-who.pyc "\$@" +if [ -f /etc/rhev-hypervisor-release ]; then + cmd_who="" + if [ -f /usr/share/virt-who/virt-who.pyc ]; then + cmd_who="virt-who.pyc" + elif [ -f /usr/share/virt-who/virtwho.pyc ]; then + cmd_who="virtwho.pyc" + else + echo "Couldn't find a known virt-who executable. Please check" + fi + + if [ ! -z $cmd_who ]; then + cat > /usr/bin/virt-who <<EOF_virt_who + #!/bin/sh + exec /usr/bin/python /usr/share/virt-who/$cmd_who "\$@" EOF_virt_who + fi +fi # set maxlogins to 3 echo "* - maxlogins 3" >> /etc/security/limits.conf -- To view, visit http://gerrit.ovirt.org/34943 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6955630310ed9b6f23336c21014ebcafce88f0f2 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: node-3.0 Gerrit-Owner: Ryan Barry <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
