commit 88de193c434f6fa60f88d3c83f1c49cef218da23
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Wed Sep 11 15:10:23 2013 +0200
SlavePool: add MapperError exception
This commit adds a new exception class- MapperError that can be used to
report errors that arise during machine matching. In a previous patch
where I fixed corner cases of machine matching I used SlaveMachineError
which wasn't ideal since that is used for reporting errors in
SlaveMachine xml files. So I replaced it with the MapperError.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/SlavePool.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/lnst/Controller/SlavePool.py b/lnst/Controller/SlavePool.py
index 170c9ac..c50cbe6 100644
--- a/lnst/Controller/SlavePool.py
+++ b/lnst/Controller/SlavePool.py
@@ -254,6 +254,9 @@ class SlavePool:
return machine
+class MapperError(Exception):
+ pass
+
class SetupMapper:
"""
This class can be used for matching machine setups against
@@ -338,7 +341,7 @@ class SetupMapper:
if not net_in_use:
msg = "Network '%s' contains only one machine!" %
net_name
- raise SlaveMachineError(msg)
+ raise MapperError(msg)
return topology
@@ -596,7 +599,7 @@ class SetupMapper:
for m, cons in template_topology.iteritems():
if len(cons) == 0:
msg = "Isolated machine in template topology: '%s'" %
m
- raise SlaveMachineError(msg)
+ raise MapperError(msg)
if self._map_setup(template_topology, pool_topology):
machine_map = [(tm, pm, self._iface_map[tm]) \
Show replies by date