def disable(self, retain_port=False):
self.update_server(disabled=True)<EOL>if retain_port:<EOL><INDENT>return<EOL><DEDENT>self.update_device(disabled=True)<EOL>if self.conf.dhcp_delete_namespaces and self.network.namespace:<EOL><INDENT>ns_ip = ip_lib.IPWrapper(self.root_helper,<EOL>self.network.namespace)<EOL>try:<EOL><INDENT>ns_ip.netns.delete(self.network.namespace)<EOL><DEDENT>except RuntimeError:<EOL><INDENT>msg = _('<STR_LIT>')<EOL>LOG.exception(msg, self.network.namespace)<EOL><DEDENT><DEDENT>
Teardown DHCP.

        Disable DHCP for this network by updating the remote server
        and then destroying any local device and namespace.