summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Affolter <fabian@bernewireless.net>2011-01-03 23:05:40 +0100
committerSol Jerome <sol.jerome@gmail.com>2011-01-05 20:43:36 -0600
commit9bc2e3d9e744c0a2901a337c7c457ee2dcd5ce4c (patch)
treec7583268d033e116c0e86158f1102caced105472 /src
parente8273b09264e9241b5c9c787a04f3f8bc6463c94 (diff)
downloadbcfg2-9bc2e3d9e744c0a2901a337c7c457ee2dcd5ce4c.tar.gz
bcfg2-9bc2e3d9e744c0a2901a337c7c457ee2dcd5ce4c.tar.bz2
bcfg2-9bc2e3d9e744c0a2901a337c7c457ee2dcd5ce4c.zip
Check for country changed
(cherry picked from commit be721375800bf740a26b83291086e2504d128e98) Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Admin/Init.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/lib/Server/Admin/Init.py b/src/lib/Server/Admin/Init.py
index 0c5b457cc..d49c19fa1 100644
--- a/src/lib/Server/Admin/Init.py
+++ b/src/lib/Server/Admin/Init.py
@@ -188,7 +188,7 @@ class Init(Bcfg2.Server.Admin.Mode):
self._prompt_hostname()
self._prompt_server()
self._prompt_groups()
- self._prompt_plugins()
+ # self._prompt_plugins()
self._prompt_certificate()
# Initialize the repository
@@ -218,7 +218,7 @@ class Init(Bcfg2.Server.Admin.Mode):
if newrepo != '':
self.repopath = newrepo
if os.path.isdir(self.repopath):
- response = raw_input("Directory %s exists. Overwrite? [y/N]:"\
+ response = raw_input("Directory %s exists. Overwrite? [y/N]:" \
% self.repopath)
if response.lower().strip() == 'y':
break
@@ -272,15 +272,19 @@ class Init(Bcfg2.Server.Admin.Mode):
def _prompt_certificate(self):
"""Ask for the key details (country, state, and location)."""
print "The following questions affects the certificate."
- print "If there are data provided the default values are used."
+ print "If there are no data provided the default values are used."
newcountry = raw_input("Country name (2 letter code) for certificate: ")
if newcountry != '':
- if len(newcountry) > '2' or len(newcountry) < '2':
- newcountry = raw_input("Country name (2 letter code) for certificate: ")
+ if len(newcountry) == 2:
+ country = newcountry
else:
- self.country = newcountry
+ while len(newcountry) != 2:
+ newcountry = raw_input("2 letter country code (eg. US): ")
+ if len(newcountry) == 2:
+ country = newcountry
+ break
else:
- self.country = 'US'
+ country = 'US'
newstate = raw_input("State or Province Name (full name) for certificate: ")
if newstate != '':
@@ -307,7 +311,8 @@ class Init(Bcfg2.Server.Admin.Mode):
cls = getattr(module, plugin)
cls.init_repo(self.repopath)
except Exception, e:
- print 'Plugin setup for %s failed: %s\n Check that dependencies are installed?' % (plugin, e)
+ print 'Plugin setup for %s failed: %s'
+ print 'Check that dependencies are installed?' % (plugin, e)
def init_repo(self):
"""Setup a new repo and create the content of the configuration file."""