Commit 3d67d0ab authored by Roland Denis's avatar Roland Denis

Missing meso attributes and adding type of multiline list items

parent 97b84d9c
Pipeline #6596 passed with stages
in 55 seconds
......@@ -8,13 +8,15 @@ from . import json
###############################################################################
# Directive's options converter
def csv_list(s):
def csv_list(items_type=str):
""" Comma separated values as a list. """
return [value.strip() for value in s.split(',')]
def multiline_list(s):
return lambda s: [items_type(value.strip()) for value in s.split(',')]
def multiline_list(items_type=str):
""" List formatted as a multi-line string """
return s.splitlines()
return lambda s: list(map(items_type, s.splitlines()))
###############################################################################
......@@ -82,20 +84,22 @@ class Meso(Directive):
required_arguments = 0
optional_arguments = 10
final_argument_whitespace = True
option_spec = {
'institutesname': multiline_list,
option_spec = { # Option name in lowercase!
'institutesname': multiline_list(str),
'url': directives.uri,
'financersname': multiline_list,
'financersname': multiline_list(str),
'location': str,
'gpscoordinates': multiline_list,
'gpscoordinates': multiline_list(float),
'contactname': str,
'contactaddress': str,
'totalcorenumber': int,
'totalstorage': int,
'totalgpunumber': int,
'totalram': int,
'accesspolicy': multiline_list,
'distributedinfra': multiline_list(str),
'servicename': multiline_list(str),
'etptnumber': float,
'accesspolicy': multiline_list(str),
}
has_content = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment