backup-list-instance cmd doesn't validate instance id

Bug #1363060 reported by Doug Shelley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Triaged
Low
Unassigned

Bug Description

trove backup-list bogus-instance-id returns:
+----+------+--------+-----------+---------+
| id | name | status | parent_id | updated |
+----+------+--------+-----------+---------+
+----+------+--------+-----------+---------+

I believe it should return something like this:
ERROR: No instance with an ID of 'bogus-instance-id' exists.

Doug Shelley (0-doug)
Changed in trove:
assignee: nobody → Doug Shelley (0-doug)
summary: - backup-list cmd doesn't validate instance id
+ backup-list-instance cmd doesn't validate instance id
Revision history for this message
Denis M. (dmakogon) wrote :

Actually it doesn't look like a bug. API did what you've asked - filtered backups by instance id that doesn't exist. But i do agree, that we need to raise HTTP 404 Not Found for cases like this.

I've noticed that we didn't filtering by instance ID at all,
see https://github.com/openstack/python-troveclient/blob/master/troveclient/v1/backups.py#L41-L51
and see https://github.com/openstack/trove/blob/master/trove/backup/service.py#L35-L46

Revision history for this message
Denis M. (dmakogon) wrote :

I'm marking this bug-report as invalid due to previous comments. API did what was asked for. Under the Troves hood this isn't a bug, since backend API doesn't raise ModelNotFound when trying to filter list of backups by bogus instance ID.

Changed in trove:
status: New → Invalid
Revision history for this message
Amrith Kumar (amrith) wrote :

That doesn't make it invalid, necessarily. What the person reporting the bug is saying is that something under the "Troves hood" is not doing the right thing (in his/her opinion).

I submit to you that it is your (Denis') opinion that this isn't a bug.

Revision history for this message
Amrith Kumar (amrith) wrote :

Doug, please update with new information if you believe this is still an issue (else please close this). Thanks!

Changed in trove:
status: Invalid → New
Changed in trove:
status: New → Triaged
importance: Undecided → Low
milestone: none → kilo-1
Changed in trove:
milestone: kilo-1 → kilo-2
Changed in trove:
milestone: kilo-2 → kilo-3
Doug Shelley (0-doug)
Changed in trove:
milestone: kilo-3 → next
Jian Xu (jianxuz)
Changed in trove:
assignee: Doug Shelley (0-doug) → Jian Xu (jianxuz)
Revision history for this message
dangming (743759846-7) wrote :

You can use command "trove backup-list-instance",it will return Error if instance_id is not exist

Amrith Kumar (amrith)
Changed in trove:
assignee: Jian Xu (jianxuz) → nobody
Revision history for this message
Fan Zhang (fanzhang) wrote :

I do agree with Denis, command 'trove backup-list-instance' actually did what was asked.

[root@node-141 ~](controller)# trove backup-list-instance xxxxx
+----+------+--------+-----------+---------+
| ID | Name | Status | Parent ID | Updated |
+----+------+--------+-----------+---------+
+----+------+--------+-----------+---------+

It looks fine to me. I suggest closing this bug.

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.