[node-patches] Change in ovirt-node[master]: Don't enable puppet configuration with no networking

rbarry at redhat.com rbarry at redhat.com
Fri Nov 21 16:25:20 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Don't enable puppet configuration with no networking
......................................................................

Don't enable puppet configuration with no networking

Unless networking is up, puppet can't be configured. Disable it
until networking is configured.

Change-Id: Ib5f37ba15cffa98fa17db6009d350f801bf2a227
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1166550
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/puppet/puppet_page.py
1 file changed, 21 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/33/35433/1

diff --git a/src/ovirt/node/setup/puppet/puppet_page.py b/src/ovirt/node/setup/puppet/puppet_page.py
old mode 100644
new mode 100755
index 7c8b82a..f447b60
--- a/src/ovirt/node/setup/puppet/puppet_page.py
+++ b/src/ovirt/node/setup/puppet/puppet_page.py
@@ -23,6 +23,7 @@
 from ovirt.node.plugins import Changeset
 from ovirt.node.utils import system, fs
 from ovirt.node.utils.fs import File
+from ovirt.node.utils.network import NodeNetwork
 import re
 
 """
@@ -54,12 +55,26 @@
                 }
 
     def ui_content(self):
-        ws = [ui.Header("header[0]", "Puppet Configuration"),
-              ui.Checkbox("puppet.enabled", "Enable Puppet"),
-              ui.Entry("puppet.server", "Puppet Server:"),
-              ui.Entry("puppet.certname", "Puppet Certificate Name:"),
-              ui.Divider("divider[0]"),
-              ]
+        if self.application.args.dry:
+            net_is_configured = True
+        else:
+            net_is_configured = NodeNetwork().is_configured()
+
+        ws = [ui.Header("puppet.header", _("Configure Puppet"))]
+
+        if not net_is_configured:
+            ws.extend([ui.Notice(_("network.notice"),
+                                 _("Networking is not configured, ") +
+                                 _("please configure it configuring ") +
+                                 _("Puppet"))])
+
+        else:
+            ws.extend([ui.Checkbox("puppet.enabled", _("Enable Puppet")),
+                       ui.Entry("puppet.server", _("Puppet Server:")),
+                       ui.Entry("puppet.certname",
+                                _("Puppet Certificate Name:")),
+                       ui.Divider("divider[0]"),
+                       ])
 
         page = ui.Page("page", ws)
         page.buttons = [ui.SaveButton("action.register", "Save"),


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

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