From 6bffad2e5e40582f89de6fe1b77cf8ff5da488c3 Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Tue, 30 May 2017 22:11:24 +0200 Subject: [PATCH] Make the Zone object py3 compatible This fixes the tests for the pool manager by making the Zone class hashable, so that it can be used in sets. Change-Id: Ief72a0787aa91f3e4e2b599bd0d573ac0eb9e881 --- designate/objects/zone.py | 3 +++ tests-py3.txt | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/designate/objects/zone.py b/designate/objects/zone.py index 0624e98cb..eb8661b34 100644 --- a/designate/objects/zone.py +++ b/designate/objects/zone.py @@ -188,6 +188,9 @@ class Zone(base.DictObjectMixin, base.SoftDeleteObjectMixin, "Provided object does not match " "schema", errors=errors, object=self) + def __hash__(self): + return hash(self.id) + def validate(self): errors = ValidationErrorList() diff --git a/tests-py3.txt b/tests-py3.txt index 8537bc463..224a32daa 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -1,5 +1,4 @@ # Blacklist of tests failing on Python 3 -designate.tests.test_pool_manager.test_service designate.tests.unit.test_central.test_basic designate.tests.unit.test_pool designate.tests.unit.test_producer.test_tasks