Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
Optional('topology'): {
Optional('links'): {
Any(): { # TODO Optional(Link.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
# Constraints
Optional('type'): Use(transform_to_list_or_None),
Optional('interface'): Use(transform_to_list_or_None),
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('predicates'): SequenceOfPredicates,
}
},
Any(): {
'interfaces': {
Any(): { # TODO Optional(Interface.validate_name_I)
Optional('name'): str, # not to be filled by hand
Optional('topology_file'): str, # not to be filled by hand
Optional('subsets'): {
Any(): Use(transform_to_list),
},
'devices': {
Any(): { # TODO Optional(Device.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
Optional('topology'): {
},
'devices': {
Any(): { # TODO Optional(Device.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
Optional('topology'): {
Optional('links'): {
Any(): { # TODO Optional(Link.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
production_schema = {
Optional('name'): str, # not to be filled by hand
Optional('topology_file'): str, # not to be filled by hand
Optional('subsets'): {
Any(): Use(transform_to_list),
},
'devices': {
Any(): { # TODO Optional(Device.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
'devices': {
Any(): { # TODO Optional(Device.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
Optional('topology'): {
Optional('links'): {
Any(): { # TODO Optional(Link.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
# Constraints
Optional('subsets'): {
Any(): Use(transform_to_list),
},
'devices': {
Any(): { # TODO Optional(Device.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
Optional('topology'): {
Optional('links'): {
Any(): { # TODO Optional(Link.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
Optional('topology'): {
Optional('links'): {
Any(): { # TODO Optional(Link.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
# Constraints
Optional('type'): Use(transform_to_list_or_None),
Optional('interface'): Use(transform_to_list_or_None),
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('predicates'): SequenceOfPredicates,
def match(value):
if re.match(expression, value):
return value
else:
raise YamlConfigError("Value '%s' does not match regex '%s'" %
(value, expression))
return match
production_schema = {
Optional('name'): str, # not to be filled by hand
Optional('topology_file'): str, # not to be filled by hand
Optional('subsets'): {
Any(): Use(transform_to_list),
},
'devices': {
Any(): { # TODO Optional(Device.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('name'): Use(transform_to_list_or_None), # -> match_name
Optional('platform'): Use(transform_to_list_or_None), # TODO platform vs type
Optional('tgen_platform'): Use(transform_to_list_or_None),
Optional('os'): Use(transform_to_list_or_None),
# TODO Optional('series'): Use(transform_to_list_or_None),
# TODO Optional('model'): Use(transform_to_list_or_None),
Optional('multinode_requested'): Or(bool, NoneType),
Optional('predicates'): SequenceOfPredicates,
},
},
Optional('topology'): {
Optional('links'): {
Any(): { # TODO Optional(Link.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
# Constraints
Optional('type'): Use(transform_to_list_or_None),
Optional('interface'): Use(transform_to_list_or_None),
Optional('name'): Use(transform_to_list_or_None), # -> match_name
def regex(expression):
def match(value):
if re.match(expression, value):
return value
else:
raise YamlConfigError("Value '%s' does not match regex '%s'" %
(value, expression))
return match
production_schema = {
Optional('name'): str, # not to be filled by hand
Optional('topology_file'): str, # not to be filled by hand
Optional('subsets'): {
Any(): Use(transform_to_list),
},
'devices': {
Any(): { # TODO Optional(Device.validate_name)
# Parameters
Optional('label'): Use(transform_to_list),
Optional('role'): Use(transform_to_list),
Optional('draw_rank'): int,
Optional('draw_cluster'): str,
# Constraints
Optional('type'): Use(transform_to_list_or_None), # TODO platform vs type