Override method for one in resource.py to check partition

        The partition cannot be included as a parameter to create a guest.
        Raise an exception if a consumer gives the partition parameter.

        :raises: DisallowedCreationParameter
332565
def _check_create_parameters(self, **kwargs):
        

        if 'partition' in kwargs:
            msg = "'partition' is not allowed as a create parameter. Vcmp " \
                "guests are created with the 'name' at least."
            raise DisallowedCreationParameter(msg)
        super(Guest, self)._check_create_parameters(**kwargs)
521650
void retriggerSubpartitionRequest(int subpartitionIndex) throws IOException, InterruptedException {
		checkState(partitionRequestClient != null, "Missing initial subpartition request.");

		if (increaseBackoff()) {
			partitionRequestClient.requestSubpartition(
				partitionId, subpartitionIndex, this, getCurrentBackoff());
		} else {
			failPartitionRequest();
		}
	}
659668
def container_permitted(self, name):
        
        white = self._container_whitelist
        black = self._container_blacklist
        return name not in black and (not white or name in white)
317890
def _check_load_parameters(self, **kwargs):
        

        if 'partition' in kwargs:
            msg = "'partition' is not allowed as a load parameter. Vcmp " \
                "guests are accessed by name."
            raise DisallowedReadParameter(msg)
        super(Guest, self)._check_load_parameters(**kwargs)
977538
def validate(self, sources):
        
        if not isinstance(sources, Root):
            raise Exception("Source object expected")

        parameters = self.get_uri_with_missing_parameters(sources)
        for parameter in parameters:
            logging.getLogger().warn('Missing parameter "%s" in uri of method "%s" in versions "%s"' % (parameter["name"], parameter["method"], parameter["version"]))
953659
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # synchronous operation
        partition_oid = uri_parms[0]
        partition_uri = '/api/partitions/' + partition_oid
        try:
            partition = hmc.lookup_by_uri(partition_uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        cpc = partition.manager.parent
        assert cpc.dpm_enabled
        check_valid_cpc_status(method, uri, cpc)
        check_partition_status(method, uri, partition,
                               invalid_statuses=['starting', 'stopping'])

        # Parse and check required query parameters
        query_parms = parse_query_parms(method, uri, uri_parms[1])
        try:
            image_name = query_parms['image-name']
        except KeyError:
            raise BadRequestError(
                method, uri, reason=1,
                message="Missing required URI query parameter 'image-name'")
        try:
            ins_file_name = query_parms['ins-file-name']
        except KeyError:
            raise BadRequestError(
                method, uri, reason=1,
                message="Missing required URI query parameter 'ins-file-name'")

        # Reflect the effect of mounting in the partition properties
        partition.properties['boot-iso-image-name'] = image_name
        partition.properties['boot-iso-ins-file'] = ins_file_name
        return {}
1368187
def _create_out_partition(self, tenant_id, tenant_name):
        
        vrf_prof_str = self.serv_part_vrf_prof
        self.dcnm_obj.create_partition(tenant_name, fw_const.SERV_PART_NAME,
                                       None, vrf_prof_str,
                                       desc="Service Partition")
776853
def _validate_partition_boundary(boundary):
    '''
    
    '''
    boundary = six.text_type(boundary)
    match = re.search(r'^([\d.]+)(\D*)$', boundary)
    if match:
        unit = match.group(2)
        if not unit or unit in VALID_UNITS:
            return
    raise CommandExecutionError(
        'Invalid partition boundary passed: "{0}"'.format(boundary)
    )
41679
def is_auto_partition_required(self, brain_or_object):
        
        obj = api.get_object(brain_or_object)
        if not IAnalysisRequest.providedBy(obj):
            return False
        template = obj.getTemplate()
        return template and template.getAutoPartition()
465255
def _get_leader_for_partition(self, topic, partition):
        

        key = TopicAndPartition(topic, partition)
        # reload metadata whether the partition is not available
        # or has no leader (broker is None)
        if self.topics_to_brokers.get(key) is None:
            yield self.load_metadata_for_topics(topic)

        if key not in self.topics_to_brokers:
            raise PartitionUnavailableError("%s not available" % str(key))

        returnValue(self.topics_to_brokers[key])
224433
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # async not supported yet
        partition_oid = uri_parms[0]
        partition_uri = '/api/partitions/' + partition_oid
        try:
            partition = hmc.lookup_by_uri(partition_uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        cpc = partition.manager.parent
        assert cpc.dpm_enabled
        check_valid_cpc_status(method, uri, cpc)
        check_partition_status(method, uri, partition,
                               valid_statuses=['stopped'])

        # Reflect the result of starting the partition
        partition.properties['status'] = 'active'
        return {}
757400
def as_partition(self, partition=0, **kwargs):
        

        assert isinstance(self._name, Name), "Wrong type: {}".format(type(self._name))
        assert isinstance(self._on, DatasetNumber), "Wrong type: {}".format(type(self._on))

        name = self._name.as_partition(**kwargs)
        on = self._on.as_partition(partition)

        return PartitionIdentity(name, on)
848838
public static boolean checkPartitionBelongsToNode(int partition,
                                                      int nodeId,
                                                      Cluster cluster,
                                                      StoreDefinition storeDef) {
        List<Integer> nodePartitions = cluster.getNodeById(nodeId).getPartitionIds();
        List<Integer> replicatingPartitions = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                                                                 cluster)
                                                                          .getReplicatingPartitionList(partition);
        replicatingPartitions.retainAll(nodePartitions);
        return replicatingPartitions.size() > 0;
    }
825596
def deny(cls, action, **kwargs):
        
        return cls.create(action, exclude=True, **kwargs)
532388
def assert_allowed(request, level, pid):
    
    if not d1_gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists():
        raise d1_common.types.exceptions.NotFound(
            0,
            'Attempted to perform operation on non-existing object. pid="{}"'.format(
                pid
            ),
        )
    if not is_allowed(request, level, pid):
        raise d1_common.types.exceptions.NotAuthorized(
            0,
            'Operation is denied. level="{}", pid="{}", active_subjects="{}"'.format(
                level_to_action(level), pid, format_active_subjects(request)
            ),
        )
438366
def can_create_replica_without_replication_connection(self):
        
        replica_methods = self._create_replica_methods
        return any(self.replica_method_can_work_without_replication_connection(method) for method in replica_methods)
183929
def has_required_params(self):
        '''
        
        '''
        return self.consumer_key and\
                self.consumer_secret and\
                self.resource_link_id and\
                self.launch_url