diff options
author | Sam Morrison <sorrison@gmail.com> | 2020-11-03 18:12:01 +1100 |
---|---|---|
committer | Sam Morrison <sorrison@gmail.com> | 2020-11-05 12:02:11 +1100 |
commit | de12499a57c0a55db6cd5f80b237dd3b53524f7f (patch) | |
tree | 871cae5023a24908a31e8c6e1508fec48bb1c319 /trove/extensions/common/models.py | |
parent | 71d99e2c56a0b6decfdf845ed40b35788645fffb (diff) | |
download | trove-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.py | 5 |
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: |