View source on GitHub
|
Coerces the value to accommodate Docker CMD/ENTRYPOINT requirements.
Inherits From: Type, Validator, expected_type
google.appengine.api.validation.Exec(
default=None
)
Validates the value is a string, then tries to modify the string (if
necessary) so that the command represented will become PID 1 inside the
Docker container. See Docker documentation on docker kill for more
information: https://docs.docker.com/engine/reference/commandline/kill/.
If the command already starts with exec or appears to be in "exec form"
(starts with [), no further action is needed. Otherwise, prepend the
command with exec so that it will become PID 1 on execution.
Child Classes
Methods
CheckFieldInitialized
CheckFieldInitialized(
value, key, obj
)
Check for missing fields or conflicts between fields.
Default behavior performs a simple None-check, but this can be overridden.
If the intent is to allow optional fields, then use the Optional validator
instead.
| Args | |
|---|---|
value
|
Value to validate. |
key
|
Name of the field being validated. |
obj
|
The object to validate against. |
| Raises | |
|---|---|
ValidationError
|
When there are missing or conflicting fields. |
GetWarnings
GetWarnings(
value, key, obj
)
Return any warnings on this attribute.
Validates the value with an eye towards things that aren't fatal problems.
| Args | |
|---|---|
value
|
Value to validate. |
key
|
Name of the field being validated. |
obj
|
The object to validate against. |
| Returns | |
|---|---|
A list of tuples (context, warning) where
|
ToValue
ToValue(
value
)
Convert value to a simplified collection or basic type.
Subclasses of Validator should override this method when the dumped
representation of value is not a simple <type>(value) (e.g., a regex).
| Args | |
|---|---|
value
|
An object of the same type that was returned from Validate().
|
| Returns | |
|---|---|
An instance of a builtin type (e.g., int, str, dict, etc). By default
it returns value unmodified.
|
Validate
Validate(
value, key
)
Validate according to parent behavior and coerce to start with exec.
__call__
__call__(
value, key='???'
)
Main interface to validator is call mechanism.
View source on GitHub