summaryrefslogtreecommitdiff
path: root/trove/extensions/common/models.py
diff options
context:
space:
mode:
authorSam Morrison <sorrison@gmail.com>2020-11-03 18:12:01 +1100
committerSam Morrison <sorrison@gmail.com>2020-11-05 12:02:11 +1100
commitde12499a57c0a55db6cd5f80b237dd3b53524f7f (patch)
tree871cae5023a24908a31e8c6e1508fec48bb1c319 /trove/extensions/common/models.py
parent71d99e2c56a0b6decfdf845ed40b35788645fffb (diff)
downloadtrove-de12499a57c0a55db6cd5f80b237dd3b53524f7f.tar.gz
Use datastore manager as opposed to name to restrict actions
Change-Id: I0e00de3bc5c0ff797fc5c1a13f0275d596c12b5d Story: 2008314 Task: 41209
Diffstat (limited to 'trove/extensions/common/models.py')
-rw-r--r--trove/extensions/common/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/trove/extensions/common/models.py b/trove/extensions/common/models.py
index 34079cd1..6b5ede6e 100644
--- a/trove/extensions/common/models.py
+++ b/trove/extensions/common/models.py
@@ -34,9 +34,10 @@ def load_and_verify(context, instance_id,
"""
instance = base_models.Instance.load(context, instance_id)
- if instance.datastore.name not in enabled_datastore:
+ if instance.datastore_version.manager not in enabled_datastore:
raise exception.UnprocessableEntity(
- f"Operation not supported for datastore {instance.datastore.name}."
+ "Operation not supported for datastore "
+ f"{instance.datastore_version.manager}."
)
if not instance.is_datastore_running: