mirror of https://github.com/docker/docker-py.git
Add docker network IPAM options parameter
Signed-off-by: Walker Lee <walkerlee.tw@gmail.com>
This commit is contained in:
parent
c7dabbfa37
commit
a3981f891d
|
@ -47,10 +47,14 @@ def create_ipam_pool(subnet=None, iprange=None, gateway=None,
|
|||
}
|
||||
|
||||
|
||||
def create_ipam_config(driver='default', pool_configs=None):
|
||||
def create_ipam_config(driver='default', pool_configs=None, options=None):
|
||||
if options is not None and not isinstance(options, dict):
|
||||
raise TypeError('IPAM options must be a dictionary')
|
||||
|
||||
return {
|
||||
'Driver': driver,
|
||||
'Config': pool_configs or []
|
||||
'Config': pool_configs or [],
|
||||
'Options': options
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -137,6 +137,7 @@ Create an IPAM (IP Address Management) config dictionary to be used with
|
|||
* driver (str): The IPAM driver to use. Defaults to `'default'`.
|
||||
* pool_configs (list): A list of pool configuration dictionaries as created
|
||||
by `docker.utils.create_ipam_pool`. Defaults to empty list.
|
||||
* options (dict): Driver options as a key-value dictionary. Defaults to `None`.
|
||||
|
||||
**Returns** An IPAM config dictionary
|
||||
|
||||
|
|
|
@ -100,7 +100,8 @@ class NetworkTest(DockerClientTest):
|
|||
"Gateway": "192.168.52.254",
|
||||
"Subnet": "192.168.52.0/24",
|
||||
"AuxiliaryAddresses": None,
|
||||
}]
|
||||
}],
|
||||
"Options": None
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -691,7 +691,8 @@ class UtilsTest(base.BaseTestCase):
|
|||
'Gateway': '192.168.52.254',
|
||||
'AuxiliaryAddresses': None,
|
||||
'IPRange': None,
|
||||
}]
|
||||
}],
|
||||
'Options': None
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue