Name contianing special character "<" gives multiple results

Bug #2060912 reported by Danny Cocks
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-designateclient
New
Undecided
Unassigned

Bug Description

In creating this bug report, I want to mention it is hard to place into the right package, as the responsibility for it lies in several packages. I believe that if the behaviour in the python-designateclient library were improved, then it'd allow the other packages to behave in more expected fashion. For this report I have kept it as specific to python-designateclient as possible.

The bug in particular is: attempting to create a recordset using a name beginning with "<" fails as the designate REST API returns multiple results. The errors given are similar to:

  Multiple matches found for <project_id>.example.org., please use ID instead.

I believe this is due to the REST API translating an initial "<" as a SQL "less than" query, and this query is made when the designateclient tries to call

  zone = v2_utils.resolve_by_name(self.list, zone)

This attempts to obtain the ID of the zone by querying the REST API with something like:

  GET /v2/zones?name=%3Cproject_id%3E.example.org.

And as the result can return more than 1 name, we hit the unusual "Multiple matches" error.

I believe this scenario could be handled in several different ways:

1) Change how the query is sent to designate, to not invoke the "less than" SQL. I'm not sure how to do this though...

2) Reject names which begin with "<" with a NotFound exception.

3) Throw a different kind of error.

Note: There is a separate issue at play that is causing us to make this weird query. We are setting the dns_domain in neutron netorks/ports to "<project_id>.example.org." and finding it is not being translated by the neutron dns extension. I am yet to explore this other issue fully yet.

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.