Don't try to enable spaces that don't have a VLAN set
Also clean up the custom IP/bird configuration on an aggregator when deleting a space. DEV-2459
This commit is contained in:
parent
8c463bebc7
commit
570012443c
@ -2,6 +2,8 @@ YAP_ID='{{ pillar['yap']['yap_id'] }}'
|
|||||||
VLAN_TRUNK='{{ pillar['yap']['trunk'] }}'
|
VLAN_TRUNK='{{ pillar['yap']['trunk'] }}'
|
||||||
declare -A SPACES
|
declare -A SPACES
|
||||||
{% if pillar['yap']['spaces'] %}{% for name, space in pillar['yap']['spaces'].items() %}
|
{% if pillar['yap']['spaces'] %}{% for name, space in pillar['yap']['spaces'].items() %}
|
||||||
|
{% if space.get('id') %}
|
||||||
SPACES[{{ name }}]='{{ space['id'] }} {{ space['vlan'] }} {{ space.get('ip', '') }}'
|
SPACES[{{ name }}]='{{ space['id'] }} {{ space['vlan'] }} {{ space.get('ip', '') }}'
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}{% endif %}
|
{% endfor %}{% endif %}
|
||||||
|
9
yap
9
yap
@ -653,6 +653,15 @@ function space_delete() {
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Clean up aggregator's space IP/custom configuration automatically
|
||||||
|
for agg_section in $(list_sections /aggregators/); do
|
||||||
|
for space_path in $(list_sections $agg_section/spaces/); do
|
||||||
|
if [ "$(basename $space_path)" = "$space" ] ; then
|
||||||
|
del_section "$space_path"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
del_section "/spaces/$space"
|
del_section "/spaces/$space"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user