diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-11-08 10:20:26 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-08 10:20:26 -0500 |
commit | e461e0ffb3fc76d42019eeaa0c78909733c2951f (patch) | |
tree | 79e88aace29ffa04cc08da085de66232a2a69267 | |
parent | f5f7937a89deceae5795987d2eeae26810499b99 (diff) | |
parent | 44328048a46bdab718b7d0f27cfa405d994ed6d2 (diff) | |
download | openshift-e461e0ffb3fc76d42019eeaa0c78909733c2951f.tar.gz openshift-e461e0ffb3fc76d42019eeaa0c78909733c2951f.tar.bz2 openshift-e461e0ffb3fc76d42019eeaa0c78909733c2951f.tar.xz openshift-e461e0ffb3fc76d42019eeaa0c78909733c2951f.zip |
Merge pull request #2752 from sdodson/cluster-cidr-refactor
Refactor default sdn_cluster_network_cidr and sdn_host_subnet_length
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 769d11a42..c75b3c0c9 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -903,8 +903,8 @@ def set_sdn_facts_if_unset(facts, system_facts): if 'master' in facts: # set defaults for sdn_cluster_network_cidr and sdn_host_subnet_length # these might be overridden if they exist in the master config file - facts['master']['sdn_cluster_network_cidr'] = '10.128.0.0/14' - facts['master']['sdn_host_subnet_length'] = '9' + sdn_cluster_network_cidr = '10.128.0.0/14' + sdn_host_subnet_length = '9' master_cfg_path = os.path.join(facts['common']['config_base'], 'master/master-config.yaml') @@ -914,12 +914,17 @@ def set_sdn_facts_if_unset(facts, system_facts): if 'networkConfig' in config: if 'clusterNetworkCIDR' in config['networkConfig']: - facts['master']['sdn_cluster_network_cidr'] = \ + sdn_cluster_network_cidr = \ config['networkConfig']['clusterNetworkCIDR'] if 'hostSubnetLength' in config['networkConfig']: - facts['master']['sdn_host_subnet_length'] = \ + sdn_host_subnet_length = \ config['networkConfig']['hostSubnetLength'] + if 'sdn_cluster_network_cidr' not in facts['master']: + facts['master']['sdn_cluster_network_cidr'] = sdn_cluster_network_cidr + if 'sdn_host_subnet_length' not in facts['master']: + facts['master']['sdn_host_subnet_length'] = sdn_host_subnet_length + if 'node' in facts and 'sdn_mtu' not in facts['node']: node_ip = facts['common']['ip'] |