Browse Source

Remove confusing DB deprecation messages

When share instances were introduced a number of fields
were moved in the database model to the underlying share instance
and proxied back to the share in order to maintain compatability
with APIs that assume these to belong to the share.  A deprecation
warning was added for these.  The warning spams the API log and
confuses end users because it sounds like they or their client
should make a change to get rid of them and that cannot actually
be done.  The API would have to change to expose share instances
to end users rather than just administrators and that is not
something that we plan to do.

Remove these confusing warnings.

Closes-Bug: #1776947

Change-Id: I95e99b26f416bbf25cfd1c8f7295f3ba6220efb3
(cherry picked from commit 8bdbbd86ae)
(cherry picked from commit 0c182bca86)
tags/4.0.2
Tom Barron 11 months ago
parent
commit
ca0799125f

+ 3
- 12
manila/db/sqlalchemy/models.py View File

@@ -21,7 +21,6 @@ SQLAlchemy models for Manila data.
21 21
 
22 22
 from oslo_config import cfg
23 23
 from oslo_db.sqlalchemy import models
24
-from oslo_log import log
25 24
 from sqlalchemy import Column, Integer, String, schema
26 25
 from sqlalchemy.ext.declarative import declarative_base
27 26
 from sqlalchemy import orm
@@ -32,8 +31,6 @@ from manila.common import constants
32 31
 CONF = cfg.CONF
33 32
 BASE = declarative_base()
34 33
 
35
-LOG = log.getLogger(__name__)
36
-
37 34
 
38 35
 class ManilaBase(models.ModelBase,
39 36
                  models.TimestampMixin,
@@ -226,15 +223,9 @@ class Share(BASE, ManilaBase):
226 223
         return all_export_locations
227 224
 
228 225
     def __getattr__(self, item):
229
-        deprecated_properties = ('host', 'share_server_id', 'share_network_id',
230
-                                 'availability_zone', 'share_type_id',
231
-                                 'share_type')
232
-        proxified_properties = ('status',) + deprecated_properties
233
-
234
-        if item in deprecated_properties:
235
-            msg = ("Property '%s' is deprecated. Please use appropriate "
236
-                   "property from share instance." % item)
237
-            LOG.warning(msg)
226
+        proxified_properties = ('status', 'host', 'share_server_id',
227
+                                'share_network_id', 'availability_zone',
228
+                                'share_type_id', 'share_type')
238 229
 
239 230
         if item in proxified_properties:
240 231
             return getattr(self.instance, item, None)

+ 7
- 0
releasenotes/notes/remove-confusing-deprecation-warnings-a17c20d8973ef2bb.yaml View File

@@ -0,0 +1,7 @@
1
+---
2
+fixes:
3
+  - |
4
+    Removed confusing manila.db.sqlalchemy model messages indicating deprecated
5
+    properties for ``share_type``, ``host``, ``share_server_id``, ``share_network_id``,
6
+    ``available_zone``.  These are exposed in the API as properties of shares and
7
+    are not in fact actually deprecated as such.

Loading…
Cancel
Save