Merge "Don't assume json network config in validations"
This commit is contained in:
commit
3712cede1f
|
@ -12,13 +12,13 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
import netaddr
|
import netaddr
|
||||||
import netifaces
|
import netifaces
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import yaml
|
||||||
|
|
||||||
from osc_lib.i18n import _
|
from osc_lib.i18n import _
|
||||||
|
|
||||||
|
@ -300,8 +300,8 @@ def _validate_no_ip_change():
|
||||||
os.path.expanduser(os_net_config_file)):
|
os.path.expanduser(os_net_config_file)):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
with open(os_net_config_file) as f:
|
with open(os_net_config_file, 'r') as f:
|
||||||
network_config = json.loads(f.read())
|
network_config = yaml.safe_load(f)
|
||||||
ctlplane = [i for i in network_config.get('network_config', [])
|
ctlplane = [i for i in network_config.get('network_config', [])
|
||||||
if i.get('name') == 'br-ctlplane'][0]
|
if i.get('name') == 'br-ctlplane'][0]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue