'Determine whether a compute instance is in one of the given states.
:param target_node: A libcloud node object representing the compute
instance to examine.
:param set target_states: The states to compare the compute instance\'s
actual state against.
:return: ``True`` if the compute instance is currently in one of
``target_states``, ``False`` otherwise.'

def _node_in_state(self, target_node, target_states):

    nodes = _retry_exception(self._driver.list_nodes)
    for node in nodes:
        if (node.uuid == target_node.uuid):
            return (node.state in target_states)
    return False
