diff options
author | Craig Vyvial <cp16net@gmail.com> | 2016-01-10 23:25:34 -0600 |
---|---|---|
committer | Craig Vyvial <cp16net@gmail.com> | 2016-02-17 22:29:06 -0600 |
commit | 3199ed3ca04c23b51aa92d35c28cc344e44c786d (patch) | |
tree | 1e2d005e990a57a8fd0c77f174aef9d5f27c02bc /trove/extensions/common/models.py | |
parent | c96f4f332f7098b4d955972d828eacef9bb17ae5 (diff) | |
download | trove-3199ed3ca04c23b51aa92d35c28cc344e44c786d.tar.gz |
root enable for pxc clustered datastore
The vertica root enable extension has a similar pattern that other
datastores can use for enabling root. (i.e. pxc) Made a few changes to
abstract this logic to a cluster centric root enable controller and
still allowed the specific vertica changes to its own extension.
Adding the scenario test to verify that the root user can connect and
see the added initial data. Also added a delete of the root restore
instance.
Unit tests added for coverage.
Implements: blueprint pxc-root-enable
Change-Id: I7b59914487bedd5b0f3b40dcae6c07024920365e
Diffstat (limited to 'trove/extensions/common/models.py')
-rw-r--r-- | trove/extensions/common/models.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/trove/extensions/common/models.py b/trove/extensions/common/models.py index dfe77a6d..e3b14dc5 100644 --- a/trove/extensions/common/models.py +++ b/trove/extensions/common/models.py @@ -82,6 +82,22 @@ class Root(object): create_guest_client(context, instance_id).disable_root() +class ClusterRoot(Root): + + @classmethod + def create(cls, context, instance_id, user, root_password, + cluster_instances_list=None): + root_user = super(ClusterRoot, cls).create(context, instance_id, + user, root_password, + cluster_instances_list=None) + + if cluster_instances_list: + for instance in cluster_instances_list: + RootHistory.create(context, instance, user) + + return root_user + + class RootHistory(object): _auto_generated_attrs = ['id'] |