示例#1
0
def validate_group_spec_content(content, raise_for_rest: bool = False):
    try:
        spec = GroupSpecification.read(content)
    except (MarshmallowValidationError, PolyaxonfileError,
            PolyaxonConfigurationError) as e:
        message_error = 'Received non valid specification content. %s' % e
        if raise_for_rest:
            raise ValidationError(message_error)
        else:
            raise DjangoValidationError(message_error)

    return spec
示例#2
0
 def specification(self) -> Optional['GroupSpecification']:
     return GroupSpecification.read(self.content) if self.content else None
 def specification(self):
     return GroupSpecification.read(self.content) if self.content else None