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 commit8bdbbd86ae
) (cherry picked from commit0c182bca86
)
This commit is contained in:
parent
fda79f4ce4
commit
ca0799125f
@ -21,7 +21,6 @@ SQLAlchemy models for Manila data.
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_db.sqlalchemy import models
|
||||
from oslo_log import log
|
||||
from sqlalchemy import Column, Integer, String, schema
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy import orm
|
||||
@ -32,8 +31,6 @@ from manila.common import constants
|
||||
CONF = cfg.CONF
|
||||
BASE = declarative_base()
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class ManilaBase(models.ModelBase,
|
||||
models.TimestampMixin,
|
||||
@ -226,15 +223,9 @@ class Share(BASE, ManilaBase):
|
||||
return all_export_locations
|
||||
|
||||
def __getattr__(self, item):
|
||||
deprecated_properties = ('host', 'share_server_id', 'share_network_id',
|
||||
'availability_zone', 'share_type_id',
|
||||
'share_type')
|
||||
proxified_properties = ('status',) + deprecated_properties
|
||||
|
||||
if item in deprecated_properties:
|
||||
msg = ("Property '%s' is deprecated. Please use appropriate "
|
||||
"property from share instance." % item)
|
||||
LOG.warning(msg)
|
||||
proxified_properties = ('status', 'host', 'share_server_id',
|
||||
'share_network_id', 'availability_zone',
|
||||
'share_type_id', 'share_type')
|
||||
|
||||
if item in proxified_properties:
|
||||
return getattr(self.instance, item, None)
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Removed confusing manila.db.sqlalchemy model messages indicating deprecated
|
||||
properties for ``share_type``, ``host``, ``share_server_id``, ``share_network_id``,
|
||||
``available_zone``. These are exposed in the API as properties of shares and
|
||||
are not in fact actually deprecated as such.
|
Loading…
Reference in New Issue
Block a user