BIND 10 trac213, updated. 8f6ca91d01a5155ace94f0c044e674e58f8e7898 [213] Creating plans for adding components
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Oct 10 09:51:27 UTC 2011
The branch, trac213 has been updated
via 8f6ca91d01a5155ace94f0c044e674e58f8e7898 (commit)
from be3038ae1b595d1b9942f9aa72fa3d96aed3b22d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8f6ca91d01a5155ace94f0c044e674e58f8e7898
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Oct 10 11:49:49 2011 +0200
[213] Creating plans for adding components
-----------------------------------------------------------------------
Summary of changes:
src/lib/python/isc/bind10/component.py | 26 ++++++++++++++++++++-
src/lib/python/isc/bind10/tests/component_test.py | 2 +-
2 files changed, 26 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/bind10/component.py b/src/lib/python/isc/bind10/component.py
index c93b2fd..9de9cad 100644
--- a/src/lib/python/isc/bind10/component.py
+++ b/src/lib/python/isc/bind10/component.py
@@ -219,7 +219,31 @@ class Configurator:
Any configuration problems are expected to be handled here, so the
plan is not yet run.
"""
- pass
+ plan_add = []
+ plan = []
+ # Handle introduction of new components
+ for cname in new.keys():
+ if cname not in old:
+ params = new[cname]
+ creator = Component
+ if 'special' in params:
+ # TODO: Better error handling
+ creator = specials[params['special']]
+ component = creator(params['process'], self.__boss,
+ params['kind'])
+ priority = 0
+ if 'priority' in params:
+ priority = params['priority']
+ # We store tuples, priority first, so we can easily sort
+ plan_add.append((priority, {
+ 'component': component,
+ 'command': 'start',
+ 'name': cname
+ }))
+ # Push the starts there sorted by priority
+ plan.extend([command for (_, command) in sorted(plan_add,
+ reverse=True)])
+ return plan
def _run_plan(self, plan):
"""
diff --git a/src/lib/python/isc/bind10/tests/component_test.py b/src/lib/python/isc/bind10/tests/component_test.py
index 2d15264..e37146a 100644
--- a/src/lib/python/isc/bind10/tests/component_test.py
+++ b/src/lib/python/isc/bind10/tests/component_test.py
@@ -445,7 +445,7 @@ class ConfiguratorTest(BossUtils, unittest.TestCase):
'kind': 'core'
}
}
- # How they should be started. The are created in the order they are
+ # How they should be started. They are created in the order they are
# found in the dict, but then they should be started by priority.
# This expects that the same dict returns its keys in the same order
# every time
More information about the bind10-changes
mailing list