Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#343 closed defect (duplicate)

Error message for failing to remove config data is hard to understand

Reported by: zhanglikun Owned by: jelte
Priority: medium Milestone: Sprint-20110419
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: 1.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

Currently, when user try to remove one config data, if the type of config data is string. the error message reported by bindctl is hard to understand.
see
bindctl
-> config remove Xfrin/master_addr '1.1.1.1'

The error message is "Error: Xfrin/master_addr not found", the message should be changed to be more readable.

the following command
->config remove Xfrin/master_addr
the error message is "string index out of range "

I just feel confused about the following code in line 570-573, file bindcmd.py.

elif cmd.command == "add":
   self.config_data.add_value(identifier, cmd.params['value'])
elif cmd.command == "remove":
   self.config_data.remove_value(identifier, cmd.params['value'])

Where the value cmd.paramsvalue? is set?

Subtickets

Change History (7)

comment:1 Changed 9 years ago by zhanglikun

  • Status changed from new to reviewing

Hi, Jelte, I create the branch trac343, and commit the patch in r2996, please have a review. thanks.

comment:2 Changed 9 years ago by zhanglikun

hehe, forget to assign review to jelte.

comment:3 Changed 9 years ago by jelte

Hmm, found this old ticket that has been assigned to me for ages. Sorry for not looking at it earlier.

I think these changes are useful, but they do not address the problem (one of the new errors does not explain it better than the old, i.e. that 'add' and 'remove' only work on lists).

There were a few related changes in #202 (merged) and #384 (ongoing). I'm thinking of applying these changes in #384, and fixing the message a bit further there (then close this ticket), is that ok?

comment:4 Changed 9 years ago by shane

  • Owner changed from jelte to zhanglikun

Assigning to Likun so he can answer Jelte's suggestion. :)

comment:5 Changed 9 years ago by shane

  • Milestone set to Sprint-20110405
  • Owner changed from zhanglikun to jelte

Please see if this was resolved in #384.

comment:6 Changed 9 years ago by jelte

  • Resolution set to duplicate
  • Status changed from reviewing to closed

Now that #384 has been merged (a while ago, but i never got around to checking this ticket again), it says:

> config remove Xfrin/master_addr '1.2.3.4'
Error: /Xfrin/master_addr is not a list
> config remove Xfrin/master_addr
Error: /Xfrin/master_addr is not a list
> config remove Xfrin/master_addr[0]

which seems good to me, if not, please reopen ticket :)

comment:7 Changed 9 years ago by jelte

  • Estimated Difficulty changed from 0.0 to 1
Note: See TracTickets for help on using tickets.