tox compatable
This commit is contained in:
parent
499de0894e
commit
f2acc211a6
@ -14,9 +14,9 @@
|
||||
# limitations under the License.
|
||||
|
||||
import abc
|
||||
import traceback
|
||||
import six
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -61,7 +61,7 @@ class ServiceController(base.ServiceBase):
|
||||
|
||||
except fastly.FastlyError:
|
||||
return self.provider_resp.failed("failed to create service")
|
||||
except:
|
||||
except Exception:
|
||||
return self.provider_resp.failed("failed to create service")
|
||||
|
||||
def delete(self, service_name):
|
||||
@ -73,5 +73,5 @@ class ServiceController(base.ServiceBase):
|
||||
self.client.delete_service(service.id)
|
||||
|
||||
return self.provider_resp.deleted(service_name)
|
||||
except:
|
||||
except Exception:
|
||||
return self.provider_resp.failed("failed to delete service")
|
||||
|
@ -28,11 +28,13 @@ _LIMITS_GROUP = 'limits:storage'
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class DriverBase(object):
|
||||
|
||||
"""Base class for both data and control plane drivers
|
||||
|
||||
:param conf: Configuration containing options for this driver.
|
||||
:type conf: `oslo.config.ConfigOpts`
|
||||
"""
|
||||
|
||||
def __init__(self, conf, providers):
|
||||
self.conf = conf
|
||||
self.providers = providers
|
||||
@ -43,6 +45,7 @@ class DriverBase(object):
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class StorageDriverBase(DriverBase):
|
||||
|
||||
"""Interface definition for storage drivers.
|
||||
|
||||
Data plane storage drivers are responsible for implementing the
|
||||
@ -73,6 +76,7 @@ class StorageDriverBase(DriverBase):
|
||||
|
||||
|
||||
class ControllerBase(object):
|
||||
|
||||
"""Top-level class for controllers.
|
||||
|
||||
:param driver: Instance of the driver
|
||||
@ -85,6 +89,7 @@ class ControllerBase(object):
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class ServicesBase(ControllerBase):
|
||||
|
||||
"""This class is responsible for managing Services
|
||||
"""
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
@ -100,9 +100,9 @@ class ServicesController(base.ServicesBase):
|
||||
|
||||
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
|
||||
# TODO (amitgandhinz): return services instead once its formatted.
|
||||
# TODO(amitgandhinz): return services instead once its formatted.
|
||||
return result
|
||||
|
||||
def get(self, project_id, service_name):
|
||||
@ -114,7 +114,7 @@ class ServicesController(base.ServicesBase):
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user