[node-patches] Change in ovirt-node[master]: Puppet plugin: leave server and certname commented by default

rbarry at redhat.com rbarry at redhat.com
Sat Oct 12 14:45:58 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Puppet plugin: leave server and certname commented by default
......................................................................

Puppet plugin: leave server and certname commented by default

Previously, we left these fields in puppet.conf, but blank. This
causes problems with parsing on EL6. Leave them commented by
default and uncomment if they are enabled.

Change-Id: I2b3450b943689b941ec35fe5722aa55bacf14480
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M ovirt-node.spec.in
M src/ovirt/node/setup/puppet/puppet_page.py
2 files changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/34/20134/1

diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index a259744..66234f2 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -145,15 +145,14 @@
 %post plugin-puppet
 patch -d /usr/share/ruby/vendor_ruby/facter -p0 < \
    %{app_root}/puppet-plugin/puppet-operatingsystem.rb.patch
-
 cd /etc/puppet
 patch -p0 << EOF
 --- puppet.conf 2013-03-21 14:55:43.969130799 -0700
 +++ puppet.conf.new 2013-03-21 14:56:02.690178578 -0700
 @@ -1,4 +1,6 @@
  [main]
-+    server = ""
-+    certname = ""
++#    server = ""
++#    certname = ""
      # The Puppet log directory.
      # The default value is '$vardir/log'.
      logdir = /var/log/puppet
diff --git a/src/ovirt/node/setup/puppet/puppet_page.py b/src/ovirt/node/setup/puppet/puppet_page.py
index 653cc6c..13e6ffc 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)
-                if item in cfg:
+                item = re.match(r'^#?\s+(\w+) =', line).group(1)
+                if item in cfg and cfg[item] is not '':
+                    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/20134
To unsubscribe, visit http://gerrit.ovirt.org/settings

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