Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: vdsm-tool: add the cmd get-engine-web-ca-issuer
......................................................................

vdsm-tool: add the cmd get-engine-web-ca-issuer

If oVirt Node is registered via oVirt Engine currently
we don't show to users which engine the node is registered.
This patch extracts the issuer field from engine web ca to use
the CN (commonname) data in ovirt-node-plugin-vdsm.

Change-Id: I70a19f54169498c53cabba0ac75e7a5611762ece
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1039267
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
---
M lib/vdsm/tool/validate_ovirt_certs.py.in
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/27651/1

diff --git a/lib/vdsm/tool/validate_ovirt_certs.py.in 
b/lib/vdsm/tool/validate_ovirt_certs.py.in
index 6a8c13f..149dc30 100644
--- a/lib/vdsm/tool/validate_ovirt_certs.py.in
+++ b/lib/vdsm/tool/validate_ovirt_certs.py.in
@@ -35,6 +35,7 @@
 PATH_CERT = '/etc/pki/vdsm/certs/'
 PATH_CACERT = PATH_CERT + 'cacert.pem'
 PATH_VDSMCERT = PATH_CERT + 'vdsmcert.pem'
+PATH_ENGINE_WEB_CA = PATH_CERT + 'engine_web_ca.pem'
 
 
 def is_our_cafile(cacert):
@@ -60,3 +61,17 @@
                 os.chown(PATH_CACERT, uid, gid)
                 ovirtfunctions.ovirt_store_config(PATH_CACERT)
                 break
+
+
+@expose('get-engine-web-ca-issuer')
+def get_engine_web_ca_issuer():
+    """
+    Extract from engine web ca certificate the issuer field
+    """
+    if os.path.exists(PATH_ENGINE_WEB_CA):
+        cmd = [
+            EX_OPENSSL, 'x509', '-in', PATH_ENGINE_WEB_CA, '-noout', '-issuer'
+        ]
+        rc, out, err = execCmd(cmd, raw=True)
+        if not err:
+            print(out),


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

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

Reply via email to