rackerlabs/python-clouddns — pull request #30 by igorsobreira (2013-04-02 02:21:11+00:00)
Title: Fix bug when searching for domain using multiple keywords

`Domain.get_record()` was using a weak dict comparison that returns "true" as soon as a key->value matches.

So if I had two records like:

- `type='CNAME'`, `name='demo.site.com'`
- `type='CNAME'`, `name='sample.site.com'`

and search for `domain.get_record(type='CNAME', name='sample.site.com')` it could return the first record, because `'type'` key would match.

Also, since it's a dict, this error could become inconsistent because dict keys have no order (if it searched for `'name'` key before `'type'` in this case, would work fine)

Note that I've created a small function `is_subdict()` to handle it, and used on `Connection.get_domain()` because I found the same loop. Just for consistency.