[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pki-devel] [PATCH] 275 - remove dnsdomainname check



Thanks for the check Endi.  Lets try this again.  

This time, we default instead to the hostname, instead of exiting.

Ade

On Tue, 2016-02-09 at 11:38 -0600, Endi Sukma Dewata wrote:
> On 2/9/2016 10:53 AM, Ade Lee wrote:
> > This check is unnecessary and is breaking continuous integration in
> > OpenStack.  Removing from pkispawn/pkidestroy.
> > 
> > Ade
> 
> If I'm reading the code correctly the pki_dns_domainname is used as a
> label to populate other properties (e.g. security domain names, admin
> email, nickname). While the label itself is not crucial to server 
> operations, the patch removes the code that's supposed obtain the
> proper 
> label. So under normal usage (i.e. outside CI) the pki_dns_domainname
> will be None, and those other properties will have incomplete values.
> 
> I think there are several options:
> 
> 1. Instead of removing the check, the code should assign a better 
> default value (e.g. example.com) to pki_dns_domainname if the domain 
> name is not available due to CI.
> 
> 2. Remove the check, but also remove all references to 
> pki_dns_domainname from the entire code.
> 
From e410eed7eace50a9ebb7057c574934445e3b1ee0 Mon Sep 17 00:00:00 2001
From: Ade Lee <alee redhat com>
Date: Wed, 10 Feb 2016 07:01:14 -0500
Subject: [PATCH] Modify dnsdomainname test in pkispawn

We do a check for the dnsdomainname, which fails in Openstack
CI because this is not set.  Instead of exiting, default to
the hostname.
---
 base/server/python/pki/server/deployment/pkimessages.py | 2 +-
 base/server/sbin/pkidestroy                             | 2 +-
 base/server/sbin/pkispawn                               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/server/python/pki/server/deployment/pkimessages.py b/base/server/python/pki/server/deployment/pkimessages.py
index b16051b6c19f1e6d8d88b7419781a11c5dee27f4..b58915fe269c26bece62677974431caf783004c4 100644
--- a/base/server/python/pki/server/deployment/pkimessages.py
+++ b/base/server/python/pki/server/deployment/pkimessages.py
@@ -69,7 +69,7 @@ PKI_DIRECTORY_ALREADY_EXISTS_NOT_A_DIRECTORY_1 = \
 PKI_DIRECTORY_MISSING_OR_NOT_A_DIRECTORY_1 = \
     "Directory '%s' is either missing or is NOT a directory!"
 PKI_DNS_DOMAIN_NOT_SET = \
-    "A valid DNS domain name MUST be established to use PKI services!"
+    "DNS domain name has not been set - using the hostname instead."
 PKI_FILE_ALREADY_EXISTS_1 = "File '%s' already exists!"
 PKI_FILE_ALREADY_EXISTS_NOT_A_FILE_1 = \
     "File '%s' already exists BUT it is NOT a file!"
diff --git a/base/server/sbin/pkidestroy b/base/server/sbin/pkidestroy
index 032c97984280a8c6ef701acfdeced6a066f56801..12d37f2f39b56958e95eea98d92128d8f206301c 100755
--- a/base/server/sbin/pkidestroy
+++ b/base/server/sbin/pkidestroy
@@ -91,7 +91,7 @@ def main(argv):
         config.pki_dns_domainname = dnsdomainname
         if not len(config.pki_dns_domainname):
             print(log.PKI_DNS_DOMAIN_NOT_SET)
-            sys.exit(1)
+            config.pki_dns_domainname = config.pki_hostname
     except subprocess.CalledProcessError as exc:
         print(log.PKI_SUBPROCESS_ERROR_1 % exc)
         sys.exit(1)
diff --git a/base/server/sbin/pkispawn b/base/server/sbin/pkispawn
index 7d839851faa20ebd5b53b0dd3be2fc77e0a3f69f..5892a671f3bf286553efeed3e63fd96b7a0265bd 100755
--- a/base/server/sbin/pkispawn
+++ b/base/server/sbin/pkispawn
@@ -93,7 +93,7 @@ def main(argv):
         config.pki_dns_domainname = dnsdomainname
         if not len(config.pki_dns_domainname):
             print(log.PKI_DNS_DOMAIN_NOT_SET)
-            sys.exit(1)
+            config.pki_dns_domainname = config.pki_hostname
     except subprocess.CalledProcessError as exc:
         print(log.PKI_SUBPROCESS_ERROR_1 % exc)
         sys.exit(1)
-- 
2.4.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]