tox compatable
This commit is contained in:
parent
499de0894e
commit
f2acc211a6
@ -14,9 +14,9 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
import traceback
|
|
||||||
import six
|
import six
|
||||||
import sys
|
import sys
|
||||||
|
import traceback
|
||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class ServiceController(base.ServiceBase):
|
|||||||
|
|
||||||
except fastly.FastlyError:
|
except fastly.FastlyError:
|
||||||
return self.provider_resp.failed("failed to create service")
|
return self.provider_resp.failed("failed to create service")
|
||||||
except:
|
except Exception:
|
||||||
return self.provider_resp.failed("failed to create service")
|
return self.provider_resp.failed("failed to create service")
|
||||||
|
|
||||||
def delete(self, service_name):
|
def delete(self, service_name):
|
||||||
@ -73,5 +73,5 @@ class ServiceController(base.ServiceBase):
|
|||||||
self.client.delete_service(service.id)
|
self.client.delete_service(service.id)
|
||||||
|
|
||||||
return self.provider_resp.deleted(service_name)
|
return self.provider_resp.deleted(service_name)
|
||||||
except:
|
except Exception:
|
||||||
return self.provider_resp.failed("failed to delete service")
|
return self.provider_resp.failed("failed to delete service")
|
||||||
|
@ -28,11 +28,13 @@ _LIMITS_GROUP = 'limits:storage'
|
|||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
class DriverBase(object):
|
class DriverBase(object):
|
||||||
|
|
||||||
"""Base class for both data and control plane drivers
|
"""Base class for both data and control plane drivers
|
||||||
|
|
||||||
:param conf: Configuration containing options for this driver.
|
:param conf: Configuration containing options for this driver.
|
||||||
:type conf: `oslo.config.ConfigOpts`
|
:type conf: `oslo.config.ConfigOpts`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, conf, providers):
|
def __init__(self, conf, providers):
|
||||||
self.conf = conf
|
self.conf = conf
|
||||||
self.providers = providers
|
self.providers = providers
|
||||||
@ -43,6 +45,7 @@ class DriverBase(object):
|
|||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
class StorageDriverBase(DriverBase):
|
class StorageDriverBase(DriverBase):
|
||||||
|
|
||||||
"""Interface definition for storage drivers.
|
"""Interface definition for storage drivers.
|
||||||
|
|
||||||
Data plane storage drivers are responsible for implementing the
|
Data plane storage drivers are responsible for implementing the
|
||||||
@ -73,6 +76,7 @@ class StorageDriverBase(DriverBase):
|
|||||||
|
|
||||||
|
|
||||||
class ControllerBase(object):
|
class ControllerBase(object):
|
||||||
|
|
||||||
"""Top-level class for controllers.
|
"""Top-level class for controllers.
|
||||||
|
|
||||||
:param driver: Instance of the driver
|
:param driver: Instance of the driver
|
||||||
@ -85,6 +89,7 @@ class ControllerBase(object):
|
|||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
class ServicesBase(ControllerBase):
|
class ServicesBase(ControllerBase):
|
||||||
|
|
||||||
"""This class is responsible for managing Services
|
"""This class is responsible for managing Services
|
||||||
"""
|
"""
|
||||||
__metaclass__ = abc.ABCMeta
|
__metaclass__ = abc.ABCMeta
|
||||||
|
@ -100,9 +100,9 @@ class ServicesController(base.ServicesBase):
|
|||||||
|
|
||||||
result = self._session.execute(CQL_GET_ALL_SERVICES, args)
|
result = self._session.execute(CQL_GET_ALL_SERVICES, args)
|
||||||
|
|
||||||
# TODO (amitgandhinz) : build the formatted json structure from the
|
# TODO(amitgandhinz) : build the formatted json structure from the
|
||||||
# result
|
# result
|
||||||
# TODO (amitgandhinz): return services instead once its formatted.
|
# TODO(amitgandhinz): return services instead once its formatted.
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def get(self, project_id, service_name):
|
def get(self, project_id, service_name):
|
||||||
@ -114,7 +114,7 @@ class ServicesController(base.ServicesBase):
|
|||||||
|
|
||||||
result = self._session.execute(CQL_GET_SERVICE, args)
|
result = self._session.execute(CQL_GET_SERVICE, args)
|
||||||
|
|
||||||
# TODO (amitgandhinz): need to format this return result in the correct
|
# TODO(amitgandhinz): need to format this return result in the correct
|
||||||
# format.
|
# format.
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright (c) 2014 Rackspace, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
# implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user