diff options
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') |