Run "gnocchi archive-policy update" exception when definition include space character

Bug #1801314 reported by jun923.gu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-gnocchiclient (Ubuntu)
Won't Fix
Undecided
jun923.gu

Bug Description

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.

jun923.gu (gujun1989)
Changed in gnocchi (Ubuntu):
assignee: nobody → jun923.gu (gujun1989)
jun923.gu (gujun1989)
affects: gnocchi (Ubuntu) → python-gnocchiclient (Ubuntu)
jun923.gu (gujun1989)
Changed in python-gnocchiclient (Ubuntu):
status: New → Confirmed
Revision history for this message
Corey Bryant (corey.bryant) wrote :

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

Revision history for this message
jun923.gu (gujun1989) wrote :

Than you for your reply. I have open the issue on gnocchiclient project at https://github.com/gnocchixyz/python-gnocchiclient/issues/97.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Closing in line with upstream issue.

Changed in python-gnocchiclient (Ubuntu):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.