diff --git a/manila/db/sqlalchemy/api.py b/manila/db/sqlalchemy/api.py index 533657fe..b6cfae73 100644 --- a/manila/db/sqlalchemy/api.py +++ b/manila/db/sqlalchemy/api.py @@ -1136,8 +1136,8 @@ def share_create(context, values): session = get_session() with session.begin(): share_ref.save(session=session) - - return share_ref + # NOTE(u_glide): Do so to prevent errors with relationships + return share_get(context, share_ref['id'], session=session) @require_admin_context diff --git a/manila/db/sqlalchemy/models.py b/manila/db/sqlalchemy/models.py index 67906679..8020789b 100644 --- a/manila/db/sqlalchemy/models.py +++ b/manila/db/sqlalchemy/models.py @@ -164,6 +164,7 @@ class Reservation(BASE, ManilaBase): class Share(BASE, ManilaBase): """Represents an NFS and CIFS shares.""" __tablename__ = 'shares' + _extra_keys = ['name', 'export_location'] @property def name(self):