diff --git a/neutron_lib/db/sqlalchemytypes.py b/neutron_lib/db/sqlalchemytypes.py index 39cb20cb1..79c9a4882 100644 --- a/neutron_lib/db/sqlalchemytypes.py +++ b/neutron_lib/db/sqlalchemytypes.py @@ -22,6 +22,8 @@ class IPAddress(types.TypeDecorator): impl = types.String(64) + cache_ok = True + def process_result_value(self, value, dialect): return netaddr.IPAddress(value) @@ -39,6 +41,8 @@ class CIDR(types.TypeDecorator): impl = types.String(64) + cache_ok = True + def process_result_value(self, value, dialect): return netaddr.IPNetwork(value) @@ -55,6 +59,8 @@ class MACAddress(types.TypeDecorator): impl = types.String(64) + cache_ok = True + def process_result_value(self, value, dialect): return netaddr.EUI(value) @@ -77,7 +83,7 @@ class TruncatedDateTime(types.TypeDecorator): impl = types.DateTime - cache_ok = False + cache_ok = True def process_bind_param(self, value, dialect): return value.replace(microsecond=0) if value else value