[python-bugzilla] [PATCH] modify: new option --dependson

Cole Robinson crobinso at redhat.com
Mon Mar 11 21:33:19 UTC 2013


On 03/11/2013 05:25 PM, Don Zickus wrote:
> A lot of our bugs are collected into higher level bugzillas.  Having the
> ability to add, remove, overwrite the --dependson field becomes necessary.
> 
> All the backend logic exists, just implement the front end logic.
> 
> The patch is pretty straightforward except for the duplicate code to handle
> comma seperated lists.
> 
> The expected command is
> 
> bugzilla modify --dependons=123456,456789 987654
> 
> This would add bugs 123456 and 456789 to the depends on field for bz987654
> 

Sounds good to me.

>  
> +    def parse_triset_list(val):
> +        val = val or ""
> +        add_val = None
> +        rm_val = None
> +        set_val = None
> +
> +        if val.startswith("+"):
> +            add_val = val[1:].split(",")
> +        elif val.startswith("-"):
> +            rm_val = val[1:].split(",")
> +        elif val.startswith("="):
> +            set_val = val[1:].split(",")
> +        else:
> +            add_val = val.split(",")
> +        return add_val, rm_val, set_val
> +

Rather than duplicate the parse_triset() logic, just call it and .split(",")
each returned value.

Patch looks good otherwise, after that change I'll extend the test suite to
cover it as well.

Thanks,
Cole


More information about the python-bugzilla mailing list