File tree Expand file tree Collapse file tree 5 files changed +22
-4
lines changed
Expand file tree Collapse file tree 5 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -664,6 +664,16 @@ function set_mtu {
664664}
665665
666666
667+ # running_in_container - Returns true otherwise false
668+ function running_in_container {
669+ if grep -q lxc /proc/1/cgroup; then
670+ return 0
671+ fi
672+
673+ return 1
674+ }
675+
676+
667677# enable_kernel_bridge_firewall - Enable kernel support for bridge firewalling
668678function enable_kernel_bridge_firewall {
669679 # Load bridge module. This module provides access to firewall for bridged
Original file line number Diff line number Diff line change @@ -188,7 +188,9 @@ function configure_neutron_new {
188188 iniset $NEUTRON_CORE_PLUGIN_CONF ovs local_ip $HOST_IP
189189 fi
190190
191- enable_kernel_bridge_firewall
191+ if ! running_in_container; then
192+ enable_kernel_bridge_firewall
193+ fi
192194 fi
193195
194196 # DHCP Agent
Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ function neutron_plugin_configure_plugin_agent {
7171 fi
7272 if [[ " $Q_USE_SECGROUP " == " True" ]]; then
7373 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
74- enable_kernel_bridge_firewall
74+ if ! running_in_container; then
75+ enable_kernel_bridge_firewall
76+ fi
7577 else
7678 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
7779 fi
Original file line number Diff line number Diff line change @@ -88,7 +88,9 @@ function _neutron_ovs_base_configure_debug_command {
8888function _neutron_ovs_base_configure_firewall_driver {
8989 if [[ " $Q_USE_SECGROUP " == " True" ]]; then
9090 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver iptables_hybrid
91- enable_kernel_bridge_firewall
91+ if ! running_in_container; then
92+ enable_kernel_bridge_firewall
93+ fi
9294 else
9395 iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver noop
9496 fi
Original file line number Diff line number Diff line change @@ -864,7 +864,9 @@ function start_nova_rest {
864864 run_process n-crt " $NOVA_BIN_DIR /nova-cert --config-file $api_cell_conf "
865865
866866 if is_service_enabled n-net; then
867- enable_kernel_bridge_firewall
867+ if ! running_in_container; then
868+ enable_kernel_bridge_firewall
869+ fi
868870 fi
869871 run_process n-net " $NOVA_BIN_DIR /nova-network --config-file $compute_cell_conf "
870872
You can’t perform that action at this time.
0 commit comments