diff options
author | Lingxian Kong <anlin.kong@gmail.com> | 2019-09-05 23:21:08 +1200 |
---|---|---|
committer | Lingxian Kong <anlin.kong@gmail.com> | 2019-09-11 11:28:00 +1200 |
commit | c33fa6706678131e7625a605e2f1dd3a2b0cd362 (patch) | |
tree | 9e9e1749d9d476c3b9f9f5f656ca45e79b0e4f24 /trove/module | |
parent | 3c09e6178a20b99b0c54346c8661a1a3f01cc4b6 (diff) | |
download | trove-c33fa6706678131e7625a605e2f1dd3a2b0cd362.tar.gz |
Support to create public trove instance
- The users need to specify the network to create Trove instance, but
trove-taskmanager will create port in that network for Nova instance
creation. Using port gives Trove more capabilities to define how the
database service is exposed.
- Deprecate ICMP protocol for the instance.
- Restrict 'nics' parameter for creating instance.
- Add 'access' parameter for creating instance.
- Add 'public_network_id' option in order to create floating IP for the
instance.
- Do not create records for security groups, but Trove can still delete
existing instances for backward compatibility.
- Delete unreasonable Host, Account, Storage API.
Story: 2006500
Task: 36468
Task: 36466
Change-Id: I80827e1ad5e6b130cbf94c2bb7a909c44d5cf1e5
Diffstat (limited to 'trove/module')
-rw-r--r-- | trove/module/models.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/trove/module/models.py b/trove/module/models.py index 975ef13b..c75f6fc6 100644 --- a/trove/module/models.py +++ b/trove/module/models.py @@ -65,10 +65,12 @@ class Modules(object): # plus the 'all' tenant ones query_opts['visible'] = True db_info = DBModule.query().filter_by(**query_opts) - db_info = db_info.filter(or_(DBModule.tenant_id == context.tenant, - DBModule.tenant_id.is_(None))) + db_info = db_info.filter( + or_(DBModule.tenant_id == context.project_id, + DBModule.tenant_id.is_(None)) + ) if db_info.count() == 0: - LOG.debug("No modules found for tenant %s", context.tenant) + LOG.debug("No modules found for tenant %s", context.project_id) modules = db_info.all() return modules @@ -83,12 +85,12 @@ class Modules(object): query_opts = {'deleted': False, 'auto_apply': True} db_info = DBModule.query().filter_by(**query_opts) - db_info = Modules.add_tenant_filter(db_info, context.tenant) + db_info = Modules.add_tenant_filter(db_info, context.project_id) db_info = Modules.add_datastore_filter(db_info, datastore_id) db_info = Modules.add_ds_version_filter(db_info, datastore_version_id) if db_info.count() == 0: LOG.debug("No auto-apply modules found for tenant %s", - context.tenant) + context.project_id) modules = db_info.all() return modules @@ -123,7 +125,8 @@ class Modules(object): query_opts = {'deleted': False} db_info = DBModule.query().filter_by(**query_opts) if not context.is_admin: - db_info = Modules.add_tenant_filter(db_info, context.tenant) + db_info = Modules.add_tenant_filter(db_info, + context.project_id) db_info = db_info.filter(DBModule.id.in_(module_ids)) modules = db_info.all() return modules @@ -285,7 +288,7 @@ class Module(object): module = DBModule.find_by(id=module_id, deleted=False) else: module = DBModule.find_by( - id=module_id, tenant_id=context.tenant, visible=True, + id=module_id, tenant_id=context.project_id, visible=True, deleted=False) except exception.ModelNotFoundError: # See if we have the module in the 'all' tenant section |