Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase string attribute max length to 256 chars #1439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gnocchi/resource_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def __init__(self, min_length, max_length, *args, **kwargs):

meta_schema_ext = {
voluptuous.Required('min_length', default=0):
voluptuous.All(int, voluptuous.Range(min=0, max=255)),
voluptuous.Required('max_length', default=255):
voluptuous.All(int, voluptuous.Range(min=1, max=255))
voluptuous.All(int, voluptuous.Range(min=0, max=256)),
voluptuous.Required('max_length', default=256):
voluptuous.All(int, voluptuous.Range(min=1, max=256))
}

@property
Expand Down
4 changes: 2 additions & 2 deletions gnocchi/tests/functional/gabbits/resource-type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ tests:
foobar:
type: string
required: False
max_length: 255
max_length: 256
min_length: 0
uuid:
type: uuid
Expand Down Expand Up @@ -200,7 +200,7 @@ tests:
type: string
required: False
min_length: 0
max_length: 255
max_length: 256
uuid:
type: uuid
required: True
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
The maximum allowed length for string-type resource attributes has been
increased from 255 to 256 characters. This allows creating attributes
that accept values up to 256 characters long e.g. Swift container names.
Loading