'Destroy a node.
:param node: The node to be destroyed
:type node: :class:`.Node`
:param ex_destroy_nic: Destroy the NICs associated with
this node (default True).
:type node: ``bool``
:param ex_destroy_vhd: Destroy the OS disk blob associated with
this node (default True).
:type node: ``bool``
:return: True if the destroy was successful, False otherwise.
:rtype: ``bool``'

def destroy_node(self, node, ex_destroy_nic=True, ex_destroy_vhd=True):

    try:
        self.connection.request(node.id, params={'api-version': '2015-06-15'}, method='DELETE')
    except BaseHTTPError as h:
        if (h.code == 202):
            pass
        else:
            return False
    while True:
        try:
            time.sleep(10)
            self.connection.request(node.id, params={'api-version': '2015-06-15'})
        except BaseHTTPError as h:
            if (h.code == 404):
                break
            else:
                return False
    interfaces = node.extra['properties']['networkProfile']['networkInterfaces']
    if ex_destroy_nic:
        for nic in interfaces:
            while True:
                try:
                    self.connection.request(nic['id'], params={'api-version': '2015-06-15'}, method='DELETE')
                    break
                except BaseHTTPError as h:
                    if (h.code == 202):
                        break
                    inuse = h.message.startswith('[NicInUse]')
                    if ((h.code == 400) and inuse):
                        time.sleep(10)
                    else:
                        return False
    vhd_uri = node.extra['properties']['storageProfile']['osDisk']['vhd']['uri']
    if ex_destroy_vhd:
        while True:
            try:
                resourceGroup = node.id.split('/')[4]
                self._ex_delete_old_vhd(resourceGroup, vhd_uri)
                break
            except LibcloudError as e:
                if ('LeaseIdMissing' in str(e)):
                    time.sleep(10)
                else:
                    raise
    return True
