[node-patches] Change in ovirt-node[master]: Various puppet plugin problems

rbarry at redhat.com rbarry at redhat.com
Fri Oct 11 18:59:52 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Various puppet plugin problems
......................................................................

Various puppet plugin problems

Get the puppet plugin to patch the correct file on EL6, add missing apostrophes
around a require, and tweak the patch a bit.

Change-Id: I5aac7e8ec2aaa6e9a0de0aa225ba3588ac109277
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1003440
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M ovirt-node.spec.in
M plugins/ovirt.rb
M plugins/puppet-operatingsystem.rb.patch
M src/ovirt/node/setup/puppet/puppet_page.py
4 files changed, 14 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/25/20125/1

diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index a259744..76099e6 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -143,9 +143,12 @@
 This package provides a puppet plugin for use with %{product_family} image.
 
 %post plugin-puppet
+%if %{is_el6}
+patch -d /usr/lib/ruby/site_ruby/1.8/facter -p0 < \
+%else
 patch -d /usr/share/ruby/vendor_ruby/facter -p0 < \
+%endif
    %{app_root}/puppet-plugin/puppet-operatingsystem.rb.patch
-
 cd /etc/puppet
 patch -p0 << EOF
 --- puppet.conf 2013-03-21 14:55:43.969130799 -0700
diff --git a/plugins/ovirt.rb b/plugins/ovirt.rb
index 0b914b3..b01c5c2 100644
--- a/plugins/ovirt.rb
+++ b/plugins/ovirt.rb
@@ -23,19 +23,20 @@
         if FileTest.exists?("/etc/system-release")
             txt = File.read("/etc/system-release")
             if txt =~ /^(.*?)\srelease.*/
-                $1
+                $1.gsub(//, '')
             end
         elsif FileTest.exists?("/etc/default/version")
             txt = File.read("/etc/default/version")
-            if txt =~ /^PRODUCT='(.*?)\s/
-                $1
+            if txt =~ /^PRODUCT='(.*?)'/
+                $1.gsub(//, '')
             end
         end
     end
 end
 
 Facter.add(:operatingsystemrelease) do
-    confine :operatingsystem => %w{oVirt}
+    confine :operatingsystem => %w{oVirt oVirtNodeHypervisor
+                                   RedHatEnterpriseVirtualizationHypervisor}
     setcode do
         if FileText.exists?("/etc/system-release")
             txt = File.text("/etc/system-release")
diff --git a/plugins/puppet-operatingsystem.rb.patch b/plugins/puppet-operatingsystem.rb.patch
index 3af2af8..23ff5e6 100644
--- a/plugins/puppet-operatingsystem.rb.patch
+++ b/plugins/puppet-operatingsystem.rb.patch
@@ -17,8 +17,8 @@
 -       "Ubuntu"
 +    if FileTest.exists?("/etc/default/version")
 +      txt = File.read("/etc/default/version")
-+      if txt =~ /^PRODUCT='(.*?)\s/ 
-+          $1
++      if txt =~ /^PRODUCT='(.*?)'/ 
++          $1.gsub(/\s/, '')
 +      end
 +    elsif Facter.value(:lsbdistid) == "Ubuntu"
 +      "Ubuntu"
diff --git a/src/ovirt/node/setup/puppet/puppet_page.py b/src/ovirt/node/setup/puppet/puppet_page.py
index 653cc6c..df913ef 100644
--- a/src/ovirt/node/setup/puppet/puppet_page.py
+++ b/src/ovirt/node/setup/puppet/puppet_page.py
@@ -144,8 +144,10 @@
         conf_builder = ""
         for line in conf:
             try:
-                item = re.match(r'^\s+(\w+) =', line).group(1)
+                item = re.match(r'^#?\s+(\w+) =', line).group(1)
                 if item in cfg:
+                    if re.match(r'^#.*', line):
+                        line = re.sub(r'^#', '', line)
                     conf_builder += re.sub(r'(^.*?' + item + ' =).*',
                                            r'\1 "' + cfg[item] + '"',
                                            line)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5aac7e8ec2aaa6e9a0de0aa225ba3588ac109277
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list