Merge "Adds support fot IpamDriver.GetCapabilities"
This commit is contained in:
commit
fb7b0480ee
@ -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.
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user