interfaces are restarted twice on changes

Bug #1485634 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-net-config
Fix Committed
Critical
Dan Prince

Bug Description

Running a simple os-net-config file to configure a single network interface:

network_config:
  -
    type: interface
    name: eth0
    use_dhcp: true

----

I'm seeing interfaces that get started twice. This can cause dhclient to fail since it is already running on the previously configured interface. See below:

[2015/08/17 02:53:07 PM] [INFO] running ifup on interface: eth0
[2015/08/17 02:53:24 PM] [INFO] running ifup on interface: eth0
Traceback (most recent call last):
  File "/bin/os-net-config", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/os_net_config/cli.py", line 180, in main
    activate=not opts.no_activate)
  File "/usr/lib/python2.7/site-packages/os_net_config/impl_ifcfg.py", line 313, in apply
    self.ifup(interface)
  File "/usr/lib/python2.7/site-packages/os_net_config/__init__.py", line 127, in ifup
    self.execute(msg, '/sbin/ifup', interface)
  File "/usr/lib/python2.7/site-packages/os_net_config/__init__.py", line 107, in execute
    processutils.execute(cmd, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 275, in execute
    cmd=sanitized_cmd)
oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
Command: /sbin/ifup eth0
Exit code: 1
Stdout: u'\nDetermining IP information for eth0... failed.\n'
Stderr: u'dhclient(710) is already running - exiting. \n\nThis version of ISC DHCP is based on th'
+ RETVAL=1

Dan Prince (dan-prince)
Changed in os-net-config:
importance: Undecided → Critical
status: New → In Progress
assignee: nobody → Dan Prince (dan-prince)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-net-config (master)

Fix proposed to branch: master
Review: https://review.openstack.org/213746

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-net-config (master)

Reviewed: https://review.openstack.org/213746
Committed: https://git.openstack.org/cgit/openstack/os-net-config/commit/?id=5e48946bcc863bb8a5f19f1c96f11355ba84e96c
Submitter: Jenkins
Branch: master

commit 5e48946bcc863bb8a5f19f1c96f11355ba84e96c
Author: Dan Prince <email address hidden>
Date: Mon Aug 17 10:57:15 2015 -0400

    os-net-config: ensure ifup is called just once

    This patch fixes an issue in the ifcfg provider implementation
    that caused interfaces to be started twice. This can
    cause failures if the interface uses DHCP and dhclient
    was already running.

    The child_members function was incorrectly adding the interface
    name to the child members set on key error. This patch removes
    that logic and simply ignores key errors.

    Change-Id: Ibe0e32bc09979bc68b92a722b2bfa383e77502a9
    Closes-bug: #1485634

Changed in os-net-config:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.