Closed atward closed 7 years ago
try changing tags_spec to be
@memoized_property
def tags_spec(self):
# http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
# Keys = 127 UTF-8 '^aws:' reserved. Values = 255 UTF-8
return dictof(
valid_string_spec(validators.regexed("^.{0,127}$"))
, formatted(string_spec(), after_format=valid_string_spec(validators.regexed("^(?!aws:).{0,255}$")), formatter=MergedOptionStringFormatter)
)
The difference is formatted taking in the after_format variable so it validates after the string has been formatted.
Though I'm confused at the error that is been risen.
It's complaining because the formatted doesn't know how to format the value (https://github.com/delfick/input_algorithms/blob/master/input_algorithms/spec_base.py#L158) but formatted has normalise_either and I don't see how it'd return NotSpecified.
What I expect is that the valid_string_spec raises an error saying {formatted} doesn't match your regex.....
This does fix the issue. Though I don't think it's related to the regex. Regex of '.' should match everything
oh yeah, I didn't read the regex properly before... interesting....
Closed in #75
Probably best described by example:
Also using
{region}
produces similar results.