Make config-dhcp-agent.sh bashate compliant

Change-Id: I91ede62a58cd224b7b93f4652174c09c387386d6
Partially-Implements: blueprint bashate gate
This commit is contained in:
Steven Dake 2015-05-28 10:13:35 -07:00
parent 1d299dfe9a
commit 58c1a04c49

View File

@ -26,53 +26,53 @@ neutron_conf=/etc/neutron/neutron.conf
# https://www.rdoproject.org/forum/discussion/567/packstack-allinone-grizzly-cirros-image-cannot-get-a-dhcp-address-when-a-centos-image-can/p1 # https://www.rdoproject.org/forum/discussion/567/packstack-allinone-grizzly-cirros-image-cannot-get-a-dhcp-address-when-a-centos-image-can/p1
/usr/sbin/iptables -A POSTROUTING -t mangle -p udp --dport bootpc \ /usr/sbin/iptables -A POSTROUTING -t mangle -p udp --dport bootpc \
-j CHECKSUM --checksum-fill -j CHECKSUM --checksum-fill
if [[ ${MECHANISM_DRIVERS} =~ linuxbridge ]]; then if [[ ${MECHANISM_DRIVERS} =~ linuxbridge ]]; then
interface_driver="neutron.agent.linux.interface.BridgeInterfaceDriver" interface_driver="neutron.agent.linux.interface.BridgeInterfaceDriver"
elif [[ ${MECHANISM_DRIVERS} == "openvswitch" ]]; then elif [[ ${MECHANISM_DRIVERS} == "openvswitch" ]]; then
interface_driver="neutron.agent.linux.interface.OVSInterfaceDriver" interface_driver="neutron.agent.linux.interface.OVSInterfaceDriver"
fi fi
# Logging # Logging
crudini --set $neutron_conf \ crudini --set $neutron_conf \
DEFAULT \ DEFAULT \
log_file \ log_file \
"${NEUTRON_DHCP_AGENT_LOG_FILE}" "${NEUTRON_DHCP_AGENT_LOG_FILE}"
# Configure dhcp_agent.ini # Configure dhcp_agent.ini
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
verbose \ verbose \
"${VERBOSE_LOGGING}" "${VERBOSE_LOGGING}"
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
debug \ debug \
"${DEBUG_LOGGING}" "${DEBUG_LOGGING}"
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
interface_driver \ interface_driver \
"$interface_driver" "$interface_driver"
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
dhcp_driver \ dhcp_driver \
"${DHCP_DRIVER}" "${DHCP_DRIVER}"
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
use_namespaces \ use_namespaces \
"${USE_NAMESPACES}" "${USE_NAMESPACES}"
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
delete_namespaces \ delete_namespaces \
"${DELETE_NAMESPACES}" "${DELETE_NAMESPACES}"
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
dnsmasq_config_file \ dnsmasq_config_file \
"${DNSMASQ_CONFIG_FILE}" "${DNSMASQ_CONFIG_FILE}"
crudini --set $cfg \ crudini --set $cfg \
DEFAULT \ DEFAULT \
root_helper \ root_helper \
"${ROOT_HELPER}" "${ROOT_HELPER}"
cat > ${DNSMASQ_CONFIG_FILE} <<EOF cat > ${DNSMASQ_CONFIG_FILE} <<EOF
dhcp-option-force=26,1450 dhcp-option-force=26,1450
@ -81,7 +81,7 @@ EOF
# Remove any existing qdhcp namespaces # Remove any existing qdhcp namespaces
ip netns list | grep qdhcp | while read -r line ; do ip netns list | grep qdhcp | while read -r line ; do
ip netns delete $line ip netns delete $line
done done
# Start DHCP Agent # Start DHCP Agent