summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Admin/Xcmd.py5
-rw-r--r--src/lib/Server/Core.py11
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/Server/Admin/Xcmd.py b/src/lib/Server/Admin/Xcmd.py
index 8faf68368..140465468 100644
--- a/src/lib/Server/Admin/Xcmd.py
+++ b/src/lib/Server/Admin/Xcmd.py
@@ -51,5 +51,10 @@ class Xcmd(Bcfg2.Server.Admin.Mode):
return
else:
raise
+ except Bcfg2.Proxy.ProxyError:
+ err = sys.exc_info()[1]
+ print("Proxy Error: %s" % err)
+ return
+
if data != None:
print(data)
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index 05625cf22..38f854f66 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -37,6 +37,14 @@ except:
pass
+def sort_xml(node, key=None):
+ for child in node:
+ sort_xml(child, key)
+
+ sorted_children = sorted(node, key=key)
+ node[:] = sorted_children
+
+
class CoreInitError(Exception):
"""This error is raised when the core cannot be initialized."""
pass
@@ -315,6 +323,9 @@ class Core(Component):
except:
logger.error("error in BindStructure", exc_info=1)
self.validate_goals(meta, config)
+
+ sort_xml(config, key=lambda e: e.get('name'))
+
logger.info("Generated config for %s in %.03f seconds" % \
(client, time.time() - start))
return config