def _getNodes(self, role=None, nodeType=None):
        """
        Return a list of Node objects representing the instances in the cluster
        with the given role and nodeType.
        :param role: leader, work, or None for both
        :param nodeType: An instance type or None for all types.
        :return: A list of Node objects.
        """
        allNodes = self._azureComputeClient.virtual_machines.list(self.clusterName)
        rv = []
        allNodeNames = []
        for node in allNodes:
            allNodeNames.append(node.name)
            nodeRole = node.tags.get('role', None)
            if node.provisioning_state != 'Succeeded' or (role is not None and nodeRole != role):
                continue
            if nodeType and node.hardware_profile.vm_size != nodeType:
                continue

            network_interface = self._azureNetworkClient.network_interfaces.get(self.clusterName, node.name)
            if not network_interface.ip_configurations:
                continue # no networks assigned to this node
            publicIP = self._azureNetworkClient.public_ip_addresses.get(self.clusterName, node.name)
            rv.append(Node(
                publicIP=publicIP.ip_address,
                privateIP=network_interface.ip_configurations[0].private_ip_address,
                name=node.name,
                launchTime=None,  # Not used with Azure.
                nodeType=node.hardware_profile.vm_size,
                preemptable=False) # Azure doesn't have preemptable nodes
            )
        logger.debug('All nodes in cluster: ' + ', '.join(allNodeNames))
        return rv
def _getNodes ( self , role = None , nodeType = None ) : allNodes = self . _azureComputeClient . virtual_machines . list ( self . clusterName ) rv = [ ] allNodeNames = [ ] for node in allNodes : allNodeNames . append ( node . name ) nodeRole = node . tags . get ( 'role' , None ) if node . provisioning_state != 'Succeeded' or ( role is not None and nodeRole != role ) : continue if nodeType and node . hardware_profile . vm_size != nodeType : continue network_interface = self . _azureNetworkClient . network_interfaces . get ( self . clusterName , node . name ) if not network_interface . ip_configurations : continue publicIP = self . _azureNetworkClient . public_ip_addresses . get ( self . clusterName , node . name ) rv . append ( Node ( publicIP = publicIP . ip_address , privateIP = network_interface . ip_configurations [ 0 ] . private_ip_address , name = node . name , launchTime = None , nodeType = node . hardware_profile . vm_size , preemptable = False ) ) logger . debug ( 'All nodes in cluster: ' + ', ' . join ( allNodeNames ) ) return rv
Return a list of Node objects representing the instances in the cluster
        with the given role and nodeType.
        :param role: leader, work, or None for both
        :param nodeType: An instance type or None for all types.
        :return: A list of Node objects.