summaryrefslogtreecommitdiff
path: root/oslo_config/types.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_config/types.py')
-rw-r--r--oslo_config/types.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/oslo_config/types.py b/oslo_config/types.py
index 06a81dd..74242c1 100644
--- a/oslo_config/types.py
+++ b/oslo_config/types.py
@@ -25,6 +25,7 @@ import re
import warnings
import abc
+from debtcollector import removals
import netaddr
import rfc3986
import six
@@ -891,17 +892,37 @@ class URI(ConfigType):
raise ValueError("URI scheme '%s' not in %s" %
(scheme, self.schemes))
- self.value = value
+ # NOTE(dhellmann): self.value is deprecated, and we don't want
+ # to trigger a deprecation warning ourselves so we modify
+ # self._value directly.
+ self._value = value
return value
+ @removals.removed_property
+ def value(self):
+ return self._value
+
+ @value.setter
+ def value(self, newval):
+ self._value = newval
+
+ @value.deleter
+ def value(self):
+ del self._value
+
def __repr__(self):
return 'URI'
def __eq__(self, other):
- return (
- (self.__class__ == other.__class__) and
- (self.value == other.value)
+ to_compare = ['__class__', 'max_length', 'schemes']
+ unset = object()
+ my_values = tuple(
+ getattr(self, name, unset) for name in to_compare
+ )
+ other_values = tuple(
+ getattr(other, name, unset) for name in to_compare
)
+ return my_values == other_values
def _formatter(self, value):
return value