The situation is like this: I need to update a archive-policy using gnocchi command and the definition include space character. Such like this: gnocchi archive-policy update -d "granularity: 0:03:00, points: 86400" low. When running the below code, ValueError exception raised.
#gnocchiclient/v1/archive_policy_cli.py
def archive_policy_definition(string):
parts = string.split(",")
defs = {}
for part in parts:
attr, __, value = part.partition(":")
if (attr not in ['granularity', 'points', 'timespan'] or
value is None):
raise ValueError
defs[attr] = value
if len(defs) < 2:
raise ValueError
return defs
Because the attr and value don't remove these space character. So I think this is a bug.
Hello jun923.gu,
Thank you for reporting this and making Ubuntu better. This bug is opened against the Ubuntu package only and appears to be an upstream issue. Please can you open an issue against the upstream project at https:/ /github. com/gnocchixyz/ gnocchi/ issues?
Thanks,
Corey