Merge "net-conf: make bridge and interface name optional"

This commit is contained in:
Jenkins 2016-12-21 09:36:29 +00:00 committed by Gerrit Code Review
commit aed9e1b9c1
1 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Note this script expects the following environment variables to be set # The following environment variables may be set to substitute in a
# normally these are provided by the calling SoftwareConfig resource, but # custom bridge or interface name. Normally these are provided by the calling
# they may also be set manually for testing # SoftwareConfig resource, but they may also be set manually for testing.
# $bridge_name : The bridge device name to apply # $bridge_name : The bridge device name to apply
# $interface_name : The interface name to apply # $interface_name : The interface name to apply
# #
@ -113,8 +113,8 @@ if [ -n '$network_config' ]; then
mkdir -p /etc/os-net-config mkdir -p /etc/os-net-config
# Note these variables come from the calling heat SoftwareConfig # Note these variables come from the calling heat SoftwareConfig
echo '$network_config' > /etc/os-net-config/config.json echo '$network_config' > /etc/os-net-config/config.json
sed -i "s/bridge_name/$bridge_name/" /etc/os-net-config/config.json sed -i "s/bridge_name/${bridge_name:-''}/" /etc/os-net-config/config.json
sed -i "s/interface_name/$interface_name/" /etc/os-net-config/config.json sed -i "s/interface_name/${interface_name:-''}/" /etc/os-net-config/config.json
os-net-config -c /etc/os-net-config/config.json -v --detailed-exit-codes os-net-config -c /etc/os-net-config/config.json -v --detailed-exit-codes
RETVAL=$? RETVAL=$?