Skip to content

Commit

Permalink
Merge pull request #864 from projectcalico/remove-dhcp-agent-dep
Browse files Browse the repository at this point in the history
Do not require a DHCP agent on the target compute host
  • Loading branch information
Neil Jerram authored and Neil Jerram committed Nov 10, 2015
2 parents 29d4330 + f322e1d commit e3b3a1f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion calico/etcdutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def _on_pre_resync(self):
Abstract:
Called before the initial dump is loaded and passed to
_process_initial_dump().
_on_snapshot_loaded().
"""
pass

Expand Down
13 changes: 6 additions & 7 deletions calico/openstack/mech_calico.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,12 @@ def bind_port(self, context):
call back into our check_segment_for_agent() method, which does
further checks.
"""
for agent in context.host_agents(constants.AGENT_TYPE_DHCP):
LOG.debug("Checking agent: %s", agent)
if agent["alive"]:
break
else:
LOG.warning("No live DHCP agents on host")
return
# FIXME: Actually for now we don't check for a DHCP agent,
# because we haven't yet worked out the future architecture
# for this. The key point is that we don't want to do this
# via the Neutron database and RPC mechanisms, because that is
# what causes the scaling problem that led us to switch to an
# etcd-driven DHCP agent.
return super(CalicoMechanismDriver, self).bind_port(context)

def check_segment_for_agent(self, segment, agent):
Expand Down
2 changes: 1 addition & 1 deletion calico/openstack/t_etcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ def port_etcd_data(port):
# MD4 TODO Check the old version writes 'profile_id' in a form that
# translation code in common.validate_endpoint() will work.

# Collect IPv6 and IPv6 addresses. On the way, also set the
# Collect IPv4 and IPv6 addresses. On the way, also set the
# corresponding gateway fields. If there is more than one IPv4 or IPv6
# gateway, the last one (in port['fixed_ips']) wins.
ipv4_nets = []
Expand Down
7 changes: 0 additions & 7 deletions calico/openstack/test/test_plugin_etcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,13 +893,6 @@ def test_on_felix_alive(self):
}
)

def test_bind_port_coverage(self):
context = mock.Mock()
context.host_agents.return_value = [
{"alive": False}
]
self.driver.bind_port(context)

def test_on_port_status_changed(self):
self.driver._get_db()
self.driver._db_context = mock.Mock()
Expand Down

0 comments on commit e3b3a1f

Please sign in to comment.