diff options
author | Andrew Butcher <abutcher@redhat.com> | 2016-04-19 16:53:30 -0400 |
---|---|---|
committer | Andrew Butcher <abutcher@redhat.com> | 2016-04-20 10:31:41 -0400 |
commit | bfa45e45ed906c4a83ce985ad5f4375fde950178 (patch) | |
tree | 43d6d0349a1afe3c6b79f0754059a1094f7c05bb /filter_plugins | |
parent | 7247fb26ada1973d895b5831005250cf494b6d93 (diff) | |
download | openshift-bfa45e45ed906c4a83ce985ad5f4375fde950178.tar.gz openshift-bfa45e45ed906c4a83ce985ad5f4375fde950178.tar.bz2 openshift-bfa45e45ed906c4a83ce985ad5f4375fde950178.tar.xz openshift-bfa45e45ed906c4a83ce985ad5f4375fde950178.zip |
Translate legacy facts within the oo_openshift_env filter.
Diffstat (limited to 'filter_plugins')
-rw-r--r-- | filter_plugins/oo_filters.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 242a5a6fe..57c14e9a3 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -650,7 +650,9 @@ class FilterModule(object): @staticmethod def oo_openshift_env(hostvars): - ''' Return facts which begin with "openshift_" + ''' Return facts which begin with "openshift_" and translate + legacy facts to their openshift_env counterparts. + Ex: hostvars = {'openshift_fact': 42, 'theyre_taking_the_hobbits_to': 'isengard'} returns = {'openshift_fact': 42} @@ -663,6 +665,11 @@ class FilterModule(object): for key in hostvars: if regex.match(key): facts[key] = hostvars[key] + + migrations = {'openshift_router_selector': 'openshift_hosted_router_selector'} + for old_fact, new_fact in migrations.iteritems(): + if old_fact in facts and new_fact not in facts: + facts[new_fact] = facts[old_fact] return facts @staticmethod |