Permalink
Browse files

When the database pointer in cumulus.ini is incorrect the output is m…

…isleading and suggests that a user was created when it was not.

this patch fixes that.
  • Loading branch information...
1 parent da01a68 commit 0b468c23525e8140b0613a11894837df54158ce2 BuzzTroll committed Aug 9, 2010
Showing with 18 additions and 5 deletions.
  1. +6 −4 cumulus/cb/pycb/__init__.py
  2. +12 −1 home/libexec/nimbus_new_user.py
@@ -49,21 +49,22 @@ def __init__(self):
self.default_settings()
self.load_settings()
+ conf_err_msg = ""
config_error = False
if self.auth == None:
config_error = True
- print "No authentication module set: |%s|" % (self.auth_error)
+ conf_err_msg = "No authentication module set: |%s|" % (self.auth_error)
if self.bucket == None:
config_error = True
- print "No backend set"
+ conf_err_msg = conf_err_msg + " No backend set"
if self.installdir == None:
config_error = True
- print "No install dir set"
+ conf_err_msg = conf_err_msg + " No install dir set"
if config_error:
- print """cumulus.ini file must have the following set:
+ msg = """cumulus.ini file must have the following set:
installdir=<path to cumulus installation>
The search path for cumulus.ini is:
@@ -74,6 +75,7 @@ def __init__(self):
cumulus.ini
env 'CUMULUS_SETTINGS_FILE
"""
+ raise Exception(msg + "\n" + conf_err_msg)
self.setup_logger()
@@ -4,6 +4,13 @@
Creates new Nimbus users. It will create all needed user aliases (Cumulus,
x509, and web login id)
"""
+import sys
+try:
+ import pycb
+except Exception, ex:
+ print ex
+ print "Error: please verify that your cumulus.ini file points the correct database"
+ sys.exit(1)
from nimbusweb.setup import autoca
import string
import random
@@ -13,7 +20,11 @@
import ConfigParser
from ConfigParser import SafeConfigParser
import time
-import pycb
+try:
+ import pycb
+except:
+ print "Error: please verify that your cumulus.ini file points the correct database"
+ sys.exit(1)
import pycb.tools
import pynimbusauthz
import tempfile

0 comments on commit 0b468c2

Please sign in to comment.