Merge "Address TODO in schema"
This commit is contained in:
commit
5ec4d100ec
@ -26,13 +26,13 @@ patch_options = {
|
||||
}
|
||||
}
|
||||
|
||||
# NOTE(cpp-cabrera): a string valid for use in a URI
|
||||
# TODO(cpp-cabrera): perhaps validate this further using jsonschema's
|
||||
# uri validator as per rfc3987
|
||||
patch_uri = {
|
||||
'type': 'object', 'properties': {
|
||||
'uri': {
|
||||
'type': 'string'
|
||||
'type': 'string',
|
||||
'minLength': 0,
|
||||
'maxLength': 255,
|
||||
'format': 'uri'
|
||||
},
|
||||
'additionalProperties': False
|
||||
}
|
||||
@ -41,7 +41,9 @@ patch_uri = {
|
||||
patch_group = {
|
||||
'type': 'object', 'properties': {
|
||||
'uri': {
|
||||
'type': 'string'
|
||||
'type': 'string',
|
||||
'minLength': 0,
|
||||
'maxLength': 255
|
||||
},
|
||||
'additionalProperties': False
|
||||
}
|
||||
|
@ -63,12 +63,13 @@ def pools(test, count, uri):
|
||||
:returns: (paths, weights, uris, options)
|
||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||
"""
|
||||
mongo_url = uri
|
||||
base = test.url_prefix + '/pools/'
|
||||
args = [(base + str(i), i,
|
||||
{str(i): i})
|
||||
for i in range(count)]
|
||||
for path, weight, option in args:
|
||||
uri = "%s/%s" % (uri, str(uuid.uuid4()))
|
||||
uri = "%s/%s" % (mongo_url, str(uuid.uuid4()))
|
||||
doc = {'weight': weight, 'uri': uri, 'options': option}
|
||||
test.simulate_put(path, body=jsonutils.dumps(doc))
|
||||
|
||||
|
@ -65,12 +65,13 @@ def pools(test, count, uri, group):
|
||||
:returns: (paths, weights, uris, options)
|
||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||
"""
|
||||
mongo_url = uri
|
||||
base = test.url_prefix + '/pools/'
|
||||
args = [(base + str(i), i,
|
||||
{str(i): i})
|
||||
for i in range(count)]
|
||||
for path, weight, option in args:
|
||||
uri = "%s/%s" % (uri, str(uuid.uuid4()))
|
||||
uri = "%s/%s" % (mongo_url, str(uuid.uuid4()))
|
||||
doc = {'weight': weight, 'uri': uri,
|
||||
'group': group, 'options': option}
|
||||
test.simulate_put(path, body=jsonutils.dumps(doc))
|
||||
|
@ -64,12 +64,13 @@ def pools(test, count, uri, group):
|
||||
:returns: (paths, weights, uris, options)
|
||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||
"""
|
||||
mongo_url = uri
|
||||
base = test.url_prefix + '/pools/'
|
||||
args = [(base + str(i), i,
|
||||
{str(i): i})
|
||||
for i in range(count)]
|
||||
for path, weight, option in args:
|
||||
uri = "%s/%s" % (uri, str(uuid.uuid4()))
|
||||
uri = "%s/%s" % (mongo_url, str(uuid.uuid4()))
|
||||
doc = {'weight': weight, 'uri': uri,
|
||||
'group': group, 'options': option}
|
||||
test.simulate_put(path, body=jsonutils.dumps(doc))
|
||||
|
Loading…
Reference in New Issue
Block a user