mooli tayer has uploaded a new change for review.

Change subject: _configure mid work
......................................................................

_configure mid work

Change-Id: Ie2bbb06741ce8c4088d79a325ef40723c98eb8f6
Signed-off-by: Mooli Tayer <[email protected]>
---
M lib/vdsm/constants.py.in
M lib/vdsm/tool/configurator.py
M lib/vdsm/utils.py
3 files changed, 23 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/26959/1

diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 90a04a0..3d9bec3 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -75,6 +75,7 @@
 P_VDSM_CONF = '@CONFDIR@/'
 P_VDSM_KEYS = '/etc/pki/vdsm/keys/'
 P_VDSM_LIBVIRT_PASSWD = P_VDSM_KEYS + 'libvirt_password'
+P_VDSM_CERT = '/etc/pki/vdsm/certs/vdsmcert.pem'
 
 P_VDSM_CLIENT_LOG = '@VDSMRUNDIR@/client.log'
 P_VDSM_LOG = '@VDSMLOGDIR@'
diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index 6454782..07e4c22 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -29,9 +29,9 @@
 import traceback
 
 from .. import utils
-from . import service, expose
-from ..constants import P_VDSM_EXEC, QEMU_PROCESS_GROUP, VDSM_GROUP, \
-    SANLOCK_USER, SYSCONF_PATH
+from . import service, expose, validate_ovirt_certs
+from ..constants import P_VDSM_EXEC, QEMU_PROCESS_GROUP, \
+    SANLOCK_USER, VDSM_GROUP, SYSCONF_PATH, P_VDSM_CERT
 
 CONF_PREFIX = '## beginning of configuration section by vdsm'
 CONF_SUFFIX = '## end of configuration section by vdsm'
@@ -93,6 +93,9 @@
 
 
 class LibvirtModuleConfigure(_ModuleConfigure):
+
+    #configurations=
+
     def __init__(self, env_override=None):
         super(LibvirtModuleConfigure, self).__init__()
         if env_override is None:
@@ -172,6 +175,16 @@
                         raise RuntimeError(
                             "Failed to reload upstart configuration.")
 
+    def _configure(self):
+        #ssl = config.getboolean('vars', 'ssl')
+        if utils.isOvirtNode():
+            # TODO mtayer: Move the existance check to validate_ovirt_certs?
+            if not os.path.exists(P_VDSM_CERT):
+                raise RuntimeError("vdsm: Missing certificate, vdsm not 
registered")
+            validate_ovirt_certs.validate_ovirt_certs()
+        self.removeConf()
+
+
     def validate(self):
         """
         Validate conflict in configured files
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index cd178da..be9bdaa 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -1148,6 +1148,12 @@
     os.killpg(0, 9)
     sys.exit(-3)
 
+@memoized
+def isOvirtNode():
+    return (
+        os.path.exists('/etc/rhev-hypervisor-release') or
+        glob.glob('/etc/ovirt-node-*-release')
+    )
 
 # Copied from
 # http://docs.python.org/2.6/library/itertools.html?highlight=grouper#recipes


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2bbb06741ce8c4088d79a325ef40723c98eb8f6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to