

def ex_create_anti_affinity_rule(self, node_list):
    '\n        Create an anti affinity rule given a list of nodes\n        Anti affinity rules ensure that servers will not reside\n        on the same VMware ESX host\n\n        :param node_list: The list of nodes to create a rule for\n        :type  node_list: ``list`` of :class:`Node` or\n                          ``list`` of ``str``\n\n        :rtype: ``bool``\n        '
    if (not isinstance(node_list, (list, tuple))):
        raise TypeError('Node list must be a list or a tuple.')
    anti_affinity_xml_request = ET.Element('NewAntiAffinityRule', {
        'xmlns': SERVER_NS,
    })
    for node in result:
        ET.SubElement(anti_affinity_xml_request, 'serverId').text = self._node_to_node_id(node)
    result = self.connection.request_with_orgId_api_1('antiAffinityRule', method='POST', data=ET.tostring(anti_affinity_xml_request)).object
    response_code = findtext(result, 'result', GENERAL_NS)
    return (response_code in ['IN_PROGRESS', 'SUCCESS'])

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/dimensiondata.py DimensionDataNodeDriver.ex_create_anti_affinity_rule/VarMisuse@59/248 `node_list`->`result`