Merge "Remove outdated changes"
This commit is contained in:
commit
987ccb15c8
@ -23,11 +23,6 @@ from congress.api import webservice
|
|||||||
from congress import exception
|
from congress import exception
|
||||||
|
|
||||||
|
|
||||||
def d6service(name, keys, inbox, datapath, args):
|
|
||||||
return DatasourceDriverModel(name, keys, inbox=inbox,
|
|
||||||
dataPath=datapath, **args)
|
|
||||||
|
|
||||||
|
|
||||||
class DatasourceDriverModel(base.APIModel):
|
class DatasourceDriverModel(base.APIModel):
|
||||||
"""Model for handling API requests about DatasourceDriver."""
|
"""Model for handling API requests about DatasourceDriver."""
|
||||||
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
# Copyright 2016 Styra, 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.
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
from __future__ import division
|
|
||||||
from __future__ import absolute_import
|
|
||||||
|
|
||||||
from oslo_log import log as logging
|
|
||||||
|
|
||||||
from congress.dse2 import data_service
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class deepSix(data_service.DataService):
|
|
||||||
"""A placeholder while we transition to the new arch."""
|
|
||||||
def __init__(self, name, keys, inbox=None, dataPath=None):
|
|
||||||
data_service.DataService.__init__(self, name)
|
|
||||||
self.name = name
|
|
||||||
|
|
||||||
def log_info(self, msg, *args):
|
|
||||||
LOG.info(msg, *args)
|
|
||||||
|
|
||||||
def log(self, msg, *args):
|
|
||||||
LOG.debug(msg, *args)
|
|
@ -17,14 +17,9 @@ from __future__ import print_function
|
|||||||
from __future__ import division
|
from __future__ import division
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import copy
|
|
||||||
import os
|
|
||||||
import os.path
|
|
||||||
import re
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from congress.api import action_model
|
from congress.api import action_model
|
||||||
@ -182,34 +177,3 @@ def create_datasources(bus):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
return services
|
return services
|
||||||
|
|
||||||
|
|
||||||
def load_data_service(service_name, config, cage, rootdir, id_):
|
|
||||||
"""Load service.
|
|
||||||
|
|
||||||
Load a service if not already loaded. Also loads its
|
|
||||||
module if the module is not already loaded. Returns None.
|
|
||||||
SERVICE_NAME: name of service
|
|
||||||
CONFIG: dictionary of configuration values
|
|
||||||
CAGE: instance to load service into
|
|
||||||
ROOTDIR: dir for start of module paths
|
|
||||||
ID: UUID of the service.
|
|
||||||
"""
|
|
||||||
config = copy.copy(config)
|
|
||||||
if service_name in cage.services:
|
|
||||||
return
|
|
||||||
if 'module' not in config:
|
|
||||||
raise exception.DataSourceConfigException(
|
|
||||||
"Service %s config missing 'module' entry" % service_name)
|
|
||||||
module_path = config['module']
|
|
||||||
module_name = re.sub('[^a-zA-Z0-9_]', '_', module_path)
|
|
||||||
if not os.path.isabs(module_path) and rootdir is not None:
|
|
||||||
module_path = os.path.join(rootdir, module_path)
|
|
||||||
if module_name not in sys.modules:
|
|
||||||
LOG.info("Trying to create module %s from %s",
|
|
||||||
module_name, module_path)
|
|
||||||
cage.loadModule(module_name, module_path)
|
|
||||||
LOG.info("Trying to create service %s with module %s",
|
|
||||||
service_name, module_name)
|
|
||||||
cage.createservice(name=service_name, moduleName=module_name,
|
|
||||||
args=config, type_='datasource_driver', id_=id_)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user