'Associate tag with the provided resources.
:param resources: Resources to associate a tag with.
:type resources: ``list`` of :class:`libcloud.compute.base.Node` or
:class:`.CloudSigmaDrive`
:param tag: Tag to associate with the resources.
:type tag: :class:`.CloudSigmaTag`
:return: Updated tag object.
:rtype: :class:`.CloudSigmaTag`'

def ex_tag_resources(self, resources, tag):

    resources = tag.resources[:]
    for resource in resources:
        if (not hasattr(resource, 'id')):
            raise ValueError("Resource    doesn't    have    id    attribute")
        resources.append(resource.id)
    resources = list(set(resources))
    data = {'name': tag.name, 'resources': resources}
    action = ('/tags/%s/' % tag.id)
    response = self.connection.request(action=action, method='PUT', data=data).object
    tag = self._to_tag(data=response)
    return tag
