Fix dns return values
The dns layer started returning False instead of None when things aren't found. Fix it. Change-Id: I38fd8c38d6f0ff08effdc39afbdfa90fb87adf83
This commit is contained in:
parent
e75113b593
commit
1a4b61d51d
@ -50,7 +50,7 @@ class DnsCloudMixin(_normalize.Normalizer):
|
|||||||
zone = self.dns.find_zone(
|
zone = self.dns.find_zone(
|
||||||
name_or_id=name_or_id, ignore_missing=True, **filters)
|
name_or_id=name_or_id, ignore_missing=True, **filters)
|
||||||
if not zone:
|
if not zone:
|
||||||
return False
|
return None
|
||||||
return zone
|
return zone
|
||||||
|
|
||||||
def search_zones(self, name_or_id=None, filters=None):
|
def search_zones(self, name_or_id=None, filters=None):
|
||||||
@ -172,7 +172,7 @@ class DnsCloudMixin(_normalize.Normalizer):
|
|||||||
of the zone managing the recordset.
|
of the zone managing the recordset.
|
||||||
:param name_or_id: Name or ID of the recordset
|
:param name_or_id: Name or ID of the recordset
|
||||||
|
|
||||||
:returns: A recordset dict or False if no matching recordset is
|
:returns: A recordset dict or None if no matching recordset is
|
||||||
found.
|
found.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@ -187,7 +187,7 @@ class DnsCloudMixin(_normalize.Normalizer):
|
|||||||
return self.dns.find_recordset(
|
return self.dns.find_recordset(
|
||||||
zone=zone_obj, name_or_id=name_or_id, ignore_missing=False)
|
zone=zone_obj, name_or_id=name_or_id, ignore_missing=False)
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return None
|
||||||
|
|
||||||
def search_recordsets(self, zone, name_or_id=None, filters=None):
|
def search_recordsets(self, zone, name_or_id=None, filters=None):
|
||||||
recordsets = self.list_recordsets(zone=zone)
|
recordsets = self.list_recordsets(zone=zone)
|
||||||
|
7
releasenotes/notes/fix-dns-return-c810d5e6736322f1.yaml
Normal file
7
releasenotes/notes/fix-dns-return-c810d5e6736322f1.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixed issue where the dns methods were returning False instead of None
|
||||||
|
when resources were not found.
|
||||||
|
- |
|
||||||
|
Fixed jsonification under python3.
|
Loading…
x
Reference in New Issue
Block a user