Permalink
Browse files

core: More flexible args in listen_to_dependencies

You can now specify a None key in the listen_args map.  Entries
in this map will be used for ALL components unless the individual
component overrides them.
  • Loading branch information...
MurphyMc committed Feb 27, 2013
1 parent 772ff32 commit 400d08acd37b2329003a1e43a53d472f8bc00e60
Showing with 10 additions and 0 deletions.
  1. +10 −0 pox/core.py
View
@@ -479,6 +479,16 @@ def _handle_topology_SwitchJoin (self, ...):
c = '_'.join(c.split("_")[2:-1])
components.add(c)
+ if None in listen_args:
+ # This means add it to all...
+ args = listen_args.pop(None)
+ for k,v in args.iteritems():
+ for c in components:
+ if c not in listen_args:
+ listen_args[c] = {}
+ if k not in listen_args[c]:
+ listen_args[c][k] = v
+
if set(listen_args).difference(components):
log.error("Specified listen_args for missing component(s): %s" %
(" ".join(set(listen_args).difference(components)),))

0 comments on commit 400d08a

Please sign in to comment.