diff options
author | Christian Pointner <equinox@spreadspace.org> | 2018-02-01 21:51:23 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2018-02-01 21:51:23 +0100 |
commit | e5868d83f8af19caf9e648a8c5fc7e7f784384dc (patch) | |
tree | b3744ab0e71e874d28bfa01e6647111863d21b43 /src | |
parent | sanity check for worker names and sub-names (diff) |
fix worker patterns
Diffstat (limited to 'src')
-rwxr-xr-x | src/flufigut.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/flufigut.py b/src/flufigut.py index 8decd90..d17a03a 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -157,15 +157,15 @@ class Planet: self._unassigned_components = [] def __get_worker(self, comp_name): - matched_prefix_len = 0 + match_prefix_len = 0 match = None for search_string, pattern in self._desc.worker_patterns.items(): if pattern.is_prefix: if comp_name.startswith(search_string): - if len(search_string) == matched_prefix_len: + if len(search_string) == match_prefix_len: raise Exception("component '%s': both patterns '%s' of worker '%s' and '%s' of worker '%s' match the component name and have the same length" % (comp_name, match.pattern, match.worker, pattern.pattern, pattern.worker)) - elif len(search_string) > matched_prefix_len: + elif len(search_string) > match_prefix_len: match_prefix_len = len(search_string) match = pattern else: @@ -550,6 +550,7 @@ if __name__ == '__main__': sys.exit(1) p.toXML('../templates/flumotion/', 'output/planet.xml') + print("****************************************************") print("** atmosphere **") print("**") |