diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-11-28 13:16:54 -0700 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-11-28 13:16:54 -0700 |
commit | 530ca566f0554d69ac11dd3b919be25c2e689ed6 (patch) | |
tree | 1a2013266bfaa0ce467b38c7b3ffcf64eac8408d /snaps/openstack/openstack_creator.py | |
parent | 0e06ebe62fcff9b491a0edd89bdf511f88d091e7 (diff) |
Added cluster template creator/state machine class.
Created class and tests for creating and managing cluster templates.
JIRA: SNAPS-235
Change-Id: Ia91aef9507fc39d1814dce03169aab0b784721a6
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/openstack_creator.py')
-rw-r--r-- | snaps/openstack/openstack_creator.py | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/snaps/openstack/openstack_creator.py b/snaps/openstack/openstack_creator.py index 945a78b..0caee9a 100644 --- a/snaps/openstack/openstack_creator.py +++ b/snaps/openstack/openstack_creator.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. from snaps.domain.creator import CloudObject -from snaps.openstack.utils import (nova_utils, neutron_utils, keystone_utils, - cinder_utils) +from snaps.openstack.utils import ( + nova_utils, neutron_utils, keystone_utils, cinder_utils, magnum_utils) __author__ = 'spisarski' @@ -132,3 +132,26 @@ class OpenStackVolumeObject(OpenStackCloudObject): def clean(self): raise NotImplementedError('Do not override abstract method') + + +class OpenStackMagnumObject(OpenStackCloudObject): + """ + Abstract class for all OpenStack compute creators + """ + + def __init__(self, os_creds): + """ + Constructor + :param os_creds: the OpenStack credentials object + """ + super(OpenStackMagnumObject, self).__init__(os_creds) + self._magnum = None + + def initialize(self): + self._magnum = magnum_utils.magnum_client(self._os_creds) + + def create(self): + raise NotImplementedError('Do not override abstract method') + + def clean(self): + raise NotImplementedError('Do not override abstract method') |