Diagnose bad config files.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
Ewan Mellor committed 2006-12-07 17:47:43 +00:00
1 parent 703d4b3335
commit 4f2a113ba6
1 file changed
+9 -4
+9 -4
View File
@@ -335,17 +335,22 @@ all_commands = (domain_commands + host_commands + scheduler_commands +
# Configuration File Parsing
##
config = None
if os.path.isfile(XM_CONFIG_FILE):
config = xml.dom.minidom.parse(XM_CONFIG_FILE)
else:
config = None
try:
config = xml.dom.minidom.parse(XM_CONFIG_FILE)
except:
print >>sys.stderr, ('Ignoring invalid configuration file %s.' %
XM_CONFIG_FILE)
def parseServer():
if config:
server = config.getElementsByTagName('server')
if server:
st = server[0].getAttribute('type')
if st != SERVER_XEN_API:
if st != SERVER_XEN_API and st != SERVER_LEGACY_XMLRPC:
print >>sys.stderr, ('Invalid server type %s; using %s.' %
(st, SERVER_LEGACY_XMLRPC))
st = SERVER_LEGACY_XMLRPC
return (st, server[0].getAttribute('uri'))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.