Add gateway_ip arg for static bindings
Change-Id: I9c54023d0c59840829bf311900621228696ce24e
This commit is contained in:
parent
c52244b8b9
commit
a78c9ca11c
@ -544,7 +544,7 @@ class LogicalDhcpServer(AbstractRESTResource):
|
||||
return _do_update()
|
||||
|
||||
def create_binding(self, server_uuid, mac, ip, hostname=None,
|
||||
lease_time=None, options=None):
|
||||
lease_time=None, options=None, gateway_ip=False):
|
||||
body = {'mac_address': mac, 'ip_address': ip}
|
||||
if hostname:
|
||||
body['host_name'] = hostname
|
||||
@ -552,6 +552,9 @@ class LogicalDhcpServer(AbstractRESTResource):
|
||||
body['lease_time'] = lease_time
|
||||
if options:
|
||||
body['options'] = options
|
||||
if gateway_ip is not False:
|
||||
# Note that None is valid for gateway_ip, means deleting it.
|
||||
body['gateway_ip'] = gateway_ip
|
||||
url = "%s/static-bindings" % server_uuid
|
||||
return self._client.url_post(url, body)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user