summaryrefslogtreecommitdiff
path: root/trove/taskmanager/manager.py
diff options
context:
space:
mode:
authorLingxian Kong <anlin.kong@gmail.com>2020-08-10 19:48:16 +1200
committerLingxian Kong <anlin.kong@gmail.com>2020-08-11 09:35:14 +1200
commit4de40cb5144cfd8cdc4b270f23acfdbd3eafa5be (patch)
treed8d6f9a3bdfe31193ba7c604f85862795b7569a3 /trove/taskmanager/manager.py
parent680a43002bfaba4a334736af052995373cecd349 (diff)
downloadtrove-4de40cb5144cfd8cdc4b270f23acfdbd3eafa5be.tar.gz
Support to update instance access
Change-Id: I640cd8b50fd0e0f80a1a45399b8bfdac437ae2b9
Diffstat (limited to 'trove/taskmanager/manager.py')
-rw-r--r--trove/taskmanager/manager.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/trove/taskmanager/manager.py b/trove/taskmanager/manager.py
index 2ac5de87..6259863d 100644
--- a/trove/taskmanager/manager.py
+++ b/trove/taskmanager/manager.py
@@ -458,6 +458,16 @@ class Manager(periodic_task.PeriodicTasks):
with EndNotification(context):
instance_tasks.upgrade(datastore_version)
+ def update_access(self, context, instance_id, access):
+ instance_tasks = models.BuiltInstanceTasks.load(context, instance_id)
+
+ try:
+ instance_tasks.update_access(access)
+ except Exception as e:
+ LOG.error(f"Failed to update access configuration for "
+ f"{instance_id}: {str(e)}")
+ self.update_db(task_status=InstanceTasks.UPDATING_ERROR_ACCESS)
+
def create_cluster(self, context, cluster_id):
with EndNotification(context, cluster_id=cluster_id):
cluster_tasks = models.load_cluster_tasks(context, cluster_id)