Merge "Adds support fot IpamDriver.GetCapabilities"

This commit is contained in:
Jenkins 2016-04-20 08:39:56 +00:00 committed by Gerrit Code Review
commit fb7b0480ee
2 changed files with 17 additions and 1 deletions

View File

@ -865,6 +865,20 @@ def network_driver_leave():
return flask.jsonify(const.SCHEMA['SUCCESS'])
@app.route('/IpamDriver.GetCapabilities', methods=['POST'])
def ipam_get_capabilities():
"""Provides the IPAM driver capabilities.
This function is called during the registration of the IPAM driver.
See the following link for more details about the spec:
https://github.com/docker/libnetwork/blob/master/docs/ipam.md#getcapabilities # noqa
"""
app.logger.debug("Received /IpamDriver.GetCapabilities")
capabilities = {'RequiresMACAddress': False}
return flask.jsonify(capabilities)
@app.route('/IpamDriver.GetDefaultAddressSpaces', methods=['POST'])
def ipam_get_default_address_spaces():
"""Provides the default address spaces for the IPAM.

View File

@ -44,7 +44,9 @@ class TestKuryrIpam(base.TestKuryrBase):
{"LocalDefaultAddressSpace":
config.CONF.local_default_address_space,
"GlobalDefaultAddressSpace":
config.CONF.global_default_address_space}))
config.CONF.global_default_address_space}),
('/IpamDriver.GetCapabilities',
{"RequiresMACAddress": False}))
@ddt.unpack
def test_remote_ipam_driver_endpoint(self, endpoint, expected):
response = self.app.post(endpoint)