diff options
author | Steve Baker <sbaker@redhat.com> | 2020-01-27 12:32:44 +1300 |
---|---|---|
committer | Steve Baker <sbaker@redhat.com> | 2020-04-20 12:24:17 +1200 |
commit | dffc71287e3c4910f920262cd30ea56591c29a1a (patch) | |
tree | 51d90479c66a4e51964c022f37f73822a97ed5c6 /ironic/api/controllers/base.py | |
parent | 8a143378cb3fe1963ee701d9b4cf88c352d62749 (diff) | |
download | ironic-dffc71287e3c4910f920262cd30ea56591c29a1a.tar.gz |
Centralise imports of wsme types
Instead of importing wsme types directly from the wsme packages,
import them from ironic.api.types. This reduces the number of wsme
imports throughout the codebase, and confines much of the future code
changes to the new types.py and a few other files.
Change-Id: I231a1f82915ab9e07c00857aa6210c0764b8ce4b
Story: 1651346
Diffstat (limited to 'ironic/api/controllers/base.py')
-rw-r--r-- | ironic/api/controllers/base.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ironic/api/controllers/base.py b/ironic/api/controllers/base.py index 73d7f9a08..eba5cd0a9 100644 --- a/ironic/api/controllers/base.py +++ b/ironic/api/controllers/base.py @@ -16,8 +16,8 @@ import datetime import functools from webob import exc -import wsme +from ironic.api import types as atypes from ironic.common.i18n import _ @@ -39,7 +39,7 @@ class AsDictMixin(object): return dict((k, _attr_as_pod(getattr(self, k))) for k in self.fields if hasattr(self, k) - and getattr(self, k) != wsme.Unset) + and getattr(self, k) != atypes.Unset) class Base(AsDictMixin): @@ -60,15 +60,15 @@ class Base(AsDictMixin): for k in self.as_dict(): if k not in except_list: - setattr(self, k, wsme.Unset) + setattr(self, k, atypes.Unset) class APIBase(Base): - created_at = wsme.wsattr(datetime.datetime, readonly=True) + created_at = atypes.wsattr(datetime.datetime, readonly=True) """The time in UTC at which the object is created""" - updated_at = wsme.wsattr(datetime.datetime, readonly=True) + updated_at = atypes.wsattr(datetime.datetime, readonly=True) """The time in UTC at which the object is updated""" |