diff --git a/openstack/cloud/_dns.py b/openstack/cloud/_dns.py index 52449e770..b663b06c7 100644 --- a/openstack/cloud/_dns.py +++ b/openstack/cloud/_dns.py @@ -50,7 +50,7 @@ class DnsCloudMixin(_normalize.Normalizer): zone = self.dns.find_zone( name_or_id=name_or_id, ignore_missing=True, **filters) if not zone: - return False + return None return zone def search_zones(self, name_or_id=None, filters=None): @@ -172,7 +172,7 @@ class DnsCloudMixin(_normalize.Normalizer): of the zone managing 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. """ @@ -187,7 +187,7 @@ class DnsCloudMixin(_normalize.Normalizer): return self.dns.find_recordset( zone=zone_obj, name_or_id=name_or_id, ignore_missing=False) except Exception: - return False + return None def search_recordsets(self, zone, name_or_id=None, filters=None): recordsets = self.list_recordsets(zone=zone) diff --git a/releasenotes/notes/fix-dns-return-c810d5e6736322f1.yaml b/releasenotes/notes/fix-dns-return-c810d5e6736322f1.yaml new file mode 100644 index 000000000..78b95dedd --- /dev/null +++ b/releasenotes/notes/fix-dns-return-c810d5e6736322f1.yaml @@ -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.