In AIO case, both controller and worker will run network puppet
to apply network configuration, need to check and avoid unnecessary
apply to avoid the potential conflicts.
Issue-ID: INF-94
Signed-off-by: Litao Gao <litao.gao@windriver.com>
Change-Id: I0372dd669b00a0969b5cddc0df3d9576092d564a
# synchronize with sysinv-agent audit
sysinv_agent_lock $ACQUIRE_LOCK
# synchronize with sysinv-agent audit
sysinv_agent_lock $ACQUIRE_LOCK
-# now copy the puppet changed interfaces to /etc/network/interfaces
-do_mv /var/run/interfaces.puppet /etc/network/interfaces
-
-# now restart networking service
-/etc/init.d/networking restart
+# check if this is a duplicated configuration
+if ! diff -I '^#' "/var/run/interfaces.puppet" "/etc/network/interfaces" > /dev/null; then
+ # now copy the puppet changed interfaces to /etc/network/interfaces
+ do_mv /var/run/interfaces.puppet /etc/network/interfaces
+
+ # now restart networking service
+ /etc/init.d/networking restart
+
+ sleep 5
+else
+ # need to remove this file also
+ do_rm /var/run/interfaces.puppet
+fi
# workaround the loopback label addresses cannot be configured as scope of host
# workaround the loopback label addresses cannot be configured as scope of host
-ip addr show lo | egrep "inet.*lo:" > /tmp/loop$$
+ip addr show lo | egrep "inet.*global.*lo:" > /tmp/loop$$
while read addr_info; do
echo $addr_info
while read addr_info; do
echo $addr_info