(labels)
Validate mesos_slave_isolation
Validate mesos_slave_isolation
Validate mesos_slave_isolation
def validate_labels_isolation(labels):
    """Validate mesos_slave_isolation"""
    mesos_slave_isolation = labels.get('mesos_slave_isolation')
    mesos_slave_isolation_list = mesos_slave_isolation.split(',')
    unsupported_isolations = set(mesos_slave_isolation_list) - set(
        SUPPORTED_ISOLATION)
    if (len(unsupported_isolations) > 0):
        raise exception.InvalidParameterValue(_(
            'property "labels/mesos_slave_isolation" with value '
            '"%(isolation_val)s" is not supported, supported values are: '
            '%(supported_isolation)s') % {
                'isolation_val': ', '.join(list(unsupported_isolations)),
                'supported_isolation': ', '.join(
                    SUPPORTED_ISOLATION + ['unspecified'])})
def validate_labels_isolation ( labels ) : mesos_slave_isolation = labels . get ( 'mesos_slave_isolation' ) mesos_slave_isolation_list = mesos_slave_isolation . split ( ',' ) unsupported_isolations = set ( mesos_slave_isolation_list ) - set ( SUPPORTED_ISOLATION ) if ( len ( unsupported_isolations ) > 0 ) : raise exception . InvalidParameterValue ( _ ( 'property "labels/mesos_slave_isolation" with value ' '"%(isolation_val)s" is not supported, supported values are: ' '%(supported_isolation)s' ) % { 'isolation_val' : ', ' . join ( list ( unsupported_isolations ) ) , 'supported_isolation' : ', ' . join ( SUPPORTED_ISOLATION + [ 'unspecified' ] ) } )