Comment 5 for bug 1580440

Revision history for this message
John Davidge (john-davidge) wrote : Re: neutron purge - executing command on non existing tenant print wrong command

@Alex When the tenant does not exist but has resources, the output is as you describe in the bug report. This is intended and correct. This is because neutron resources belonging to a tenant can still exist after the tenant has been deleted in keystone, or the resources could have been created with a tenant_id that has never existed in keystone.

In the case Brian describes the tenant does not exist and also has no resources. Since the existence of the tenant has no bearing on whether or not there are resources associated with it, I don't think it's relevant information to include with the output of the purge command. Especially given that the tenant_id field of a neutron resource does not have to be a valid keystone tenant ID, I don't think it should be the job of neutron purge to report on the state of keystone.

In any case, a message like "There is no tenant with "SPECIFIED ID" id found" would be misleading, as it would imply that neutron purge cannot be used in this case. We'd need two different messages to cover both cases:

1. "There is no tenant with "SPECIFIED ID" id found, and it has no support resources."
2. "Tenant has no supported resources."

Since (1) does not contain any more relevant information than (2) where the purge command is concerned, I personally don't think it would add any value, and could in fact be confusing.