Esempio n. 1
0
        'mode': file_mode,
        'owner': basestring,
        'group': basestring,
        'uid': int,
        'gid': int,
    }),
    at_most_one_of('content', 'source', 'target'),
    at_most_one_of('owner', 'uid'),
    at_most_one_of('group', 'gid'),
]

validator = one_or_more([
    tolerant_dict({
        'destination': absolute_path,
    }),
    _file_attributes,
    tolerant_dict({
        'files':
        one_or_more(
            one_of(
                basestring,
                [
                    _file_attributes,
                    tolerant_dict({
                        'filename': path,
                    }),
                ],
            )),
    }),
])
Esempio n. 2
0
import hc2002.plugin
import hc2002.resource.load_balancer
import hc2002.transform as xf
import hc2002.translation as xl
from hc2002.validation import at_most_one_of, in_, match, one_of, \
        one_or_more, prefix, validate, validate_keys, validate_values, \
        tolerant_dict

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

_block_device = [
    dict,
    validate_values({
        'source':
        one_of(match('no-device'), match('ephemeral[0-9]'),
               match('snap-[a-fA-F0-9]+')),
        'size':
        int,
        'iops':
        int,
        'disposable':
        bool,
    }),
]

_scheduled_group_action = {
    'count': int,
    'min-count': int,
    'max-count': int,
    'start-time': datetime.datetime,
    'end-time': datetime.datetime,
Esempio n. 3
0
import hc2002.plugin
import hc2002.resource.load_balancer
import hc2002.transform as xf
import hc2002.translation as xl
from hc2002.validation import at_most_one_of, in_, match, one_of, \
        one_or_more, prefix, validate, validate_keys, validate_values, \
        tolerant_dict

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

_block_device = [
    dict,
    validate_values({
        'source':       one_of(
                            match('no-device'),
                            match('ephemeral[0-9]'),
                            match('snap-[a-fA-F0-9]+')),
        'size':         int,
        'iops':         int,
        'disposable':   bool,
    }),
]

_scheduled_group_action = {
    'count':        int,
    'min-count':    int,
    'max-count':    int,
    'start-time':   datetime.datetime,
    'end-time':     datetime.datetime,
    'recurrence':   basestring,
}
Esempio n. 4
0
        'source':   url,
        'target':   path,

        'mode':     file_mode,

        'owner':    basestring,
        'group':    basestring,
        'uid':      int,
        'gid':      int,
    }),
    at_most_one_of('content', 'source', 'target'),
    at_most_one_of('owner', 'uid'),
    at_most_one_of('group', 'gid'),
]

validator = one_or_more([
    tolerant_dict({ 'destination': absolute_path, }),
    _file_attributes,
    tolerant_dict({
        'files': one_or_more(
            one_of(
                basestring,
                [
                    _file_attributes,
                    tolerant_dict({ 'filename': path, }),
                ],
            )
        ),
    }),
])