diff --git a/devstack/lib/nfp b/devstack/lib/nfp index 4385bf25a6..c1860dfbb5 100644 --- a/devstack/lib/nfp +++ b/devstack/lib/nfp @@ -362,10 +362,10 @@ function copy_nfp_files_and_start_process { echo "Starting config_orch >>>> under screen named : config_orch" run_process config_orch "sudo /usr/bin/nfp --config-file /etc/nfp_config_orch.ini --config-file /etc/neutron/neutron.conf --log-file /opt/stack/logs/nfp_config_orch.log" else - cd base_configurator/api + cd pecan/api sudo python setup.py develop echo "Starting base_configurator >>>> under screen named : base_configurator" - run_process base_configurator "cd /opt/stack/gbp/gbpservice/nfp/base_configurator/api;sudo ip netns exec nfp-proxy pecan serve config.py" + run_process base_configurator "cd /opt/stack/gbp/gbpservice/nfp/pecan/api;sudo ip netns exec nfp-proxy pecan configurator_decider config.py --mode base" fi sleep 1 diff --git a/gbpservice/nfp/base_configurator/api/root_controller.py b/gbpservice/nfp/base_configurator/api/root_controller.py deleted file mode 100644 index a2cc5d4dce..0000000000 --- a/gbpservice/nfp/base_configurator/api/root_controller.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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 pecan -from v1 import controllers - - -class RootController(object): - """This is root controller that forward the request to __init__.py - file inside controller folder inside v1 - - """ - - v1 = controllers.V1Controller() - - @pecan.expose() - def get(self): - # TODO(blogan): once a decision is made on how to do versions, do that - # here - return {'versions': [{'status': 'CURRENT', - 'updated': '2014-12-11T00:00:00Z', - 'id': 'v1'}]} diff --git a/gbpservice/nfp/base_configurator/api/base_controller.py b/gbpservice/nfp/base_configurator/base_controller.py similarity index 100% rename from gbpservice/nfp/base_configurator/api/base_controller.py rename to gbpservice/nfp/base_configurator/base_controller.py diff --git a/gbpservice/nfp/base_configurator/api/v1/controllers/__init__.py b/gbpservice/nfp/base_configurator/controllers/__init__.py similarity index 73% rename from gbpservice/nfp/base_configurator/api/v1/controllers/__init__.py rename to gbpservice/nfp/base_configurator/controllers/__init__.py index 2f9fe51b03..cded74e180 100644 --- a/gbpservice/nfp/base_configurator/api/v1/controllers/__init__.py +++ b/gbpservice/nfp/base_configurator/controllers/__init__.py @@ -12,20 +12,19 @@ import pecan -import controller +from gbpservice.nfp.base_configurator.controllers import controller -"""This class forwards HTTP request to controller class. -This class create an object of Controller class with appropriate -parameter according to the path of HTTP request. According to the -parameter passed to Controller class it sends an RPC call/cast to -configurator. - -""" +class ControllerResolver(object): + """This class forwards HTTP request to controller class. -class ControllerResolver(object): + This class create an object of Controller class with appropriate + parameter according to the path of HTTP request. According to the + parameter passed to Controller class it sends an RPC call/cast to + configurator. + """ create_network_function_device_config = controller.Controller( "create_network_function_device_config") delete_network_function_device_config = controller.Controller( @@ -41,22 +40,19 @@ class ControllerResolver(object): get_notifications = controller.Controller("get_notifications") -""" This class forwards HTTP requests starting with /v1/nfp. - -All HTTP requests with path starting from /v1 -land here. This class forward request with path starting from /v1/nfp -to ControllerResolver. - -""" +class V1Controller(object): + """ This class forwards HTTP requests starting with /v1/nfp. + All HTTP requests with path starting from /v1 + land here. This class forward request with path starting from /v1/nfp + to ControllerResolver. -class V1Controller(object): + """ nfp = ControllerResolver() @pecan.expose() def get(self): - # TODO(blogan): decide what exactly should be here, if anything return {'versions': [{'status': 'CURRENT', 'updated': '2014-12-11T00:00:00Z', 'id': 'v1'}]} diff --git a/gbpservice/nfp/base_configurator/api/v1/controllers/controller.py b/gbpservice/nfp/base_configurator/controllers/controller.py similarity index 73% rename from gbpservice/nfp/base_configurator/api/v1/controllers/controller.py rename to gbpservice/nfp/base_configurator/controllers/controller.py index 949ca14bdc..f26d42570b 100644 --- a/gbpservice/nfp/base_configurator/api/v1/controllers/controller.py +++ b/gbpservice/nfp/base_configurator/controllers/controller.py @@ -18,7 +18,7 @@ import subprocess import time -from gbpservice.nfp.base_configurator.api.base_controller import BaseController +from gbpservice.nfp.base_configurator.base_controller import BaseController LOG = logging.getLogger(__name__) TOPIC = 'configurator' @@ -26,13 +26,6 @@ SUCCESS_RESULTS = ['unhandled', 'success'] FAILURE = 'failure' -"""Implements all the APIs Invoked by HTTP requests. - -Implements following HTTP methods. - -get - -post - -""" notifications = [] cache_ips = set() @@ -40,6 +33,13 @@ class Controller(BaseController): + """Implements all the APIs Invoked by HTTP requests. + + Implements following HTTP methods. + -get + -post + + """ def __init__(self, method_name): try: self.method_name = method_name @@ -188,64 +188,6 @@ def post(self, **body): error_data = self._format_description(msg) return jsonutils.dumps(error_data) - @pecan.expose(method='PUT', content_type='application/json') - def put(self, **body): - """Method of REST server to handle all the put requests. - - This method sends an RPC cast to configurator according to the - HTTP request. - - :param body: This method excepts dictionary as a parameter in HTTP - request and send this dictionary to configurator with RPC cast. - - Returns: None - - """ - - try: - global cache_ips - global notifications - body = None - if pecan.request.is_body_readable: - body = pecan.request.json_body - - # Assuming config list will have only one element - config_data = body['config'][0] - context = body['info']['context'] - service_type = body['info']['service_type'] - resource = config_data['resource'] - - if 'device_ip' in context: - msg = ("PUTTING DATA TO VM :: %s" % body) - LOG.info(msg) - device_ip = context['device_ip'] - ip = str(device_ip) - is_vm_reachable = self._verify_vm_reachability(ip, - self.vm_port) - if is_vm_reachable: - requests.post( - 'http://' + ip + ':' + self.vm_port + '/v1/nfp/' + - self.method_name, data=jsonutils.dumps(body)) - else: - raise Exception('VM is not reachable') - cache_ips.add(device_ip) - else: - if (resource in NFP_SERVICE_LIST): - result = "unhandled" - self._push_notification(context, - result, config_data, service_type) - else: - result = "error" - self._push_notification(context, - result, config_data, service_type) - except Exception as err: - pecan.response.status = 400 - msg = ("Failed to serve HTTP post request %s %s." - % (self.method_name, str(err).capitalize())) - LOG.error(msg) - error_data = self._format_description(msg) - return jsonutils.dumps(error_data) - def _format_description(self, msg): """This methgod formats error description. diff --git a/gbpservice/nfp/base_configurator/api/__init__.py b/gbpservice/nfp/pecan/__init__.py similarity index 100% rename from gbpservice/nfp/base_configurator/api/__init__.py rename to gbpservice/nfp/pecan/__init__.py diff --git a/gbpservice/nfp/base_configurator/api/v1/__init__.py b/gbpservice/nfp/pecan/api/__init__.py similarity index 100% rename from gbpservice/nfp/base_configurator/api/v1/__init__.py rename to gbpservice/nfp/pecan/api/__init__.py diff --git a/gbpservice/nfp/base_configurator/api/config.py b/gbpservice/nfp/pecan/api/config.py similarity index 93% rename from gbpservice/nfp/base_configurator/api/config.py rename to gbpservice/nfp/pecan/api/config.py index 442308d9d0..0cab883dca 100644 --- a/gbpservice/nfp/base_configurator/api/config.py +++ b/gbpservice/nfp/pecan/api/config.py @@ -59,10 +59,3 @@ } } } - -# Custom Configurations must be in Python dictionary format:: -# -# foo = {'bar':'baz'} -# -# All configurations are accessible at:: -# pecan.conf diff --git a/gbpservice/nfp/pecan/api/configurator_decider.py b/gbpservice/nfp/pecan/api/configurator_decider.py new file mode 100644 index 0000000000..2815b6b5d3 --- /dev/null +++ b/gbpservice/nfp/pecan/api/configurator_decider.py @@ -0,0 +1,31 @@ +# 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 pecan + +from gbpservice.nfp.pecan import constants + + +class DecideConfigurator(pecan.commands.serve.ServeCommand): + ''' decides the type of configurtor to be used + like base_configurator or reference_configurator + ''' + arguments = pecan.commands.serve.ServeCommand.arguments + ({ + 'name': '--mode', + 'help': 'decides the type of configurtor to be used', + 'choices': constants.modes, + },) + + def run(self, args): + setattr(pecan, 'mode', args.mode) + super(DecideConfigurator, self).run(args) + diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/root_controller.py b/gbpservice/nfp/pecan/api/root_controller.py similarity index 61% rename from gbpservice/tests/contrib/nfp_service/reference_configurator/api/root_controller.py rename to gbpservice/nfp/pecan/api/root_controller.py index 5407e27222..bbab39bbc0 100644 --- a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/root_controller.py +++ b/gbpservice/nfp/pecan/api/root_controller.py @@ -12,7 +12,7 @@ import pecan -from v1 import controllers +from gbpservice.nfp.pecan import constants class RootController(object): @@ -20,13 +20,21 @@ class RootController(object): file inside controller folder inside v1 """ + _controllers = {} - v1 = controllers.V1Controller() + for name, controller in constants.controllers.items(): + _controllers.update({name: __import__(controller, + globals(), + locals(), + ['controllers'], -1)}) + + if pecan.mode == constants.base_with_vm: + v1 = _controllers[constants.REFERENCE_CONTROLLER].V1Controller() + elif pecan.mode == constants.base: + v1 = _controllers[constants.BASE_CONTROLLER].V1Controller() @pecan.expose() def get(self): - # TODO(blogan): once a decision is made on how to do versions, do that - # here return {'versions': [{'status': 'CURRENT', 'updated': '2014-12-11T00:00:00Z', 'id': 'v1'}]} diff --git a/gbpservice/nfp/base_configurator/api/setup.py b/gbpservice/nfp/pecan/api/setup.py similarity index 74% rename from gbpservice/nfp/base_configurator/api/setup.py rename to gbpservice/nfp/pecan/api/setup.py index e6042b44f2..1e84d2d961 100644 --- a/gbpservice/nfp/base_configurator/api/setup.py +++ b/gbpservice/nfp/pecan/api/setup.py @@ -10,7 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -# -*- coding: utf-8 -*- try: import setuptools except ImportError: @@ -30,5 +29,11 @@ test_suite='api', zip_safe=False, include_package_data=True, - packages=setuptools.find_packages(exclude=['ez_setup']) + packages=setuptools.find_packages(exclude=['ez_setup']), + # Having entry point gives the option to define custom classes + # to improve the flexibility in accessing different configurators + entry_points=""" + [pecan.command] + configurator_decider = configurator_decider:DecideConfigurator + """ ) diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/__init__.py b/gbpservice/nfp/pecan/api/v1/__init__.py similarity index 100% rename from gbpservice/tests/contrib/nfp_service/reference_configurator/api/__init__.py rename to gbpservice/nfp/pecan/api/v1/__init__.py diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/app.py b/gbpservice/nfp/pecan/api/v1/app.py similarity index 99% rename from gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/app.py rename to gbpservice/nfp/pecan/api/v1/app.py index f65e34406b..3dcb5ea236 100644 --- a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/app.py +++ b/gbpservice/nfp/pecan/api/v1/app.py @@ -16,7 +16,6 @@ def setup_app(config): app_conf = dict(config.app) - return pecan.make_app( app_conf.pop('root'), logging=getattr(config, 'logging', {}), diff --git a/gbpservice/nfp/base_configurator/api/v1/app.py b/gbpservice/nfp/pecan/constants.py similarity index 60% rename from gbpservice/nfp/base_configurator/api/v1/app.py rename to gbpservice/nfp/pecan/constants.py index f65e34406b..e7b9f3f37a 100644 --- a/gbpservice/nfp/base_configurator/api/v1/app.py +++ b/gbpservice/nfp/pecan/constants.py @@ -10,15 +10,17 @@ # License for the specific language governing permissions and limitations # under the License. -import pecan +BASE_CONTROLLER = 'base_controller' +REFERENCE_CONTROLLER = 'reference_controller' -def setup_app(config): - app_conf = dict(config.app) +controllers = { + BASE_CONTROLLER: 'gbpservice.nfp.base_configurator.controllers', + REFERENCE_CONTROLLER: ('gbpservice.tests.contrib' + '.nfp_service.reference_configurator.controllers') +} - return pecan.make_app( - app_conf.pop('root'), - logging=getattr(config, 'logging', {}), - **app_conf - ) +base_with_vm = 'base_with_vm' +base = 'base' +modes = [base, base_with_vm] diff --git a/gbpservice/tests/contrib/diskimage-create/disk_image_create.py b/gbpservice/tests/contrib/diskimage-create/disk_image_create.py index cb1a89d144..ae1d268a04 100755 --- a/gbpservice/tests/contrib/diskimage-create/disk_image_create.py +++ b/gbpservice/tests/contrib/diskimage-create/disk_image_create.py @@ -35,8 +35,8 @@ def parse_json(j_file): def get_nfp_branch_name_for_docker(file_path): data = file(file_path) - for line in data: - if 'GBPSERVICE_BRANCH' in line: + for line in data: + if not line.lstrip().startswith('#') and 'GBPSERVICE_BRANCH' in line: data.close() return line.split('=')[1].rstrip() @@ -163,8 +163,12 @@ def dib(nfp_branch_name): elif element == 'nfp-reference-configurator': image_name = 'nfp_reference_service' service_dir = "%s/../nfp_service/" % cur_dir + pecan_dir = os.path.abspath(os.path.join(cur_dir, + '../../../nfp')) service_dir = os.path.realpath(service_dir) + pecan_dir = os.path.realpath(pecan_dir) os.environ['SERVICE_GIT_PATH'] = service_dir + os.environ['PECAN_GIT_PATH'] = pecan_dir elif element == 'configurator': image_name = 'configurator' create_configurator_docker(nfp_branch_name) diff --git a/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/extra-data.d/99-nfp-service b/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/extra-data.d/99-nfp-service index 9169a0ed20..95dbb1bd43 100755 --- a/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/extra-data.d/99-nfp-service +++ b/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/extra-data.d/99-nfp-service @@ -1,7 +1,9 @@ #! /bin/bash set -eu -# copy the reference_configurator folder to VM at /root/ +# copy the reference_configurator and pecan folders to VM at /root/ cp -rL ${SERVICE_GIT_PATH}/reference_configurator ${TMP_MOUNT_PATH}/root/ +cp -rL ${PECAN_GIT_PATH}/pecan ${TMP_MOUNT_PATH}/root/ + ls -lR ${TMP_MOUNT_PATH}/root/ diff --git a/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/install.d/99-nfp-service b/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/install.d/99-nfp-service index 8cbad06c9b..f7f26f3da0 100755 --- a/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/install.d/99-nfp-service +++ b/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/install.d/99-nfp-service @@ -1,22 +1,36 @@ #! /bin/bash set -eu -# copy the reference_configurator folder to VM at /home/ubuntu/ -mv /root/reference_configurator /home/ubuntu/ -ls -lR /home/ubuntu/ +# copy the reference_configurator and pecan folders to VM at +# /usr/local/lib/python2.7/dist-packages/ + +cd /usr/local/lib/python2.7/dist-packages/ + +service_path='gbpservice/tests/contrib/nfp_service' +pecan_path='gbpservice/nfp' +mkdir -p $service_path +mkdir -p $pecan_path + +find gbpservice/ -type d -exec touch {}/__init__.py \; +mv /root/reference_configurator $service_path/ +mv /root/pecan $pecan_path/ + +cd $service_path +PWD=`pwd` +ls -lR $PWD/ # copy the pecan.service file -cp -L /home/ubuntu/reference_configurator/config/pecan.service /etc/systemd/system/pecan.service +cp -L $PWD/reference_configurator/config/pecan.service /etc/systemd/system/pecan.service chmod 777 /etc/systemd/system/pecan.service ls -l /etc/systemd/system/pecan.service -cp -L /home/ubuntu/reference_configurator/config/pecan.service /etc/systemd/system/multi-user.target.wants/pecan.service +cp -L $PWD/reference_configurator/config/pecan.service /etc/systemd/system/multi-user.target.wants/pecan.service chmod 755 /etc/systemd/system/multi-user.target.wants/pecan.service ls -l /etc/systemd/system/multi-user.target.wants/pecan.service # make pecan service to launch during each system boot -cp -rL /home/ubuntu/reference_configurator/bin/nfp-pecan /usr/bin/nfp-pecan +cp -rL $PWD/reference_configurator/bin/nfp-pecan /usr/bin/nfp-pecan chmod 777 /usr/bin/nfp-pecan ls -l /usr/bin/nfp-pecan -chmod 777 /home/ubuntu/reference_configurator/bin/nfp-pecan -ls -l /home/ubuntu/reference_configurator/bin/nfp-pecan +chmod 777 $PWD/reference_configurator/bin/nfp-pecan +ls -l $PWD/reference_configurator/bin/nfp-pecan diff --git a/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/post-install.d/99-nfp-service b/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/post-install.d/99-nfp-service index 59af03cec2..53fcf99ab2 100755 --- a/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/post-install.d/99-nfp-service +++ b/gbpservice/tests/contrib/diskimage-create/elements/nfp-reference-configurator/post-install.d/99-nfp-service @@ -4,5 +4,5 @@ apt-get install -y --force-yes python-pecan apt-get install -y --force-yes oslo.serialization oslo.log python-yaml ls -lR /home/ubuntu/ -cd /home/ubuntu/reference_configurator/api/ && python setup.py develop +cd /usr/local/lib/python2.7/dist-packages/gbpservice/nfp/pecan/api && python setup.py develop diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/config.py b/gbpservice/tests/contrib/nfp_service/reference_configurator/api/config.py deleted file mode 100644 index 442308d9d0..0000000000 --- a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/config.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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. - -# Server Specific Configurations -server = { - 'port': '8080', - 'host': '0.0.0.0' -} - -# Pecan Application Configurations -app = { - 'root': 'root_controller.RootController', - 'modules': ['v1'], - 'debug': True, - 'errors': { - 404: '/error/404', - '__force_dict__': True - } -} - -logging = { - 'root': {'level': 'INFO', 'handlers': ['console']}, - 'loggers': { - 'pecanlog': {'level': 'INFO', - 'handlers': ['console'], - 'propagate': False}, - 'pecan': {'level': 'INFO', - 'handlers': ['console'], - 'propagate': False}, - 'py.warnings': {'handlers': ['console']}, - '__force_dict__': True - }, - 'handlers': { - 'console': { - 'level': 'INFO', - 'class': 'logging.StreamHandler', - 'formatter': 'color' - } - }, - 'formatters': { - 'simple': { - 'format': ('%(asctime)s %(levelname)-5.5s [%(name)s]' - '[%(threadName)s] %(message)s') - }, - 'color': { - '()': 'pecan.log.ColorFormatter', - 'format': ('%(asctime)s [%(padded_color_levelname)s] [%(name)s]' - '[%(threadName)s] %(message)s'), - '__force_dict__': True - } - } -} - -# Custom Configurations must be in Python dictionary format:: -# -# foo = {'bar':'baz'} -# -# All configurations are accessible at:: -# pecan.conf diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/setup.py b/gbpservice/tests/contrib/nfp_service/reference_configurator/api/setup.py deleted file mode 100644 index e6042b44f2..0000000000 --- a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -# 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. - -# -*- coding: utf-8 -*- -try: - import setuptools -except ImportError: - import ez_setup - ez_setup.use_setuptools() - import setuptools - -setuptools.setup( - name='api', - version='0.1', - description='', - author='', - author_email='', - install_requires=[ - "pecan", - ], - test_suite='api', - zip_safe=False, - include_package_data=True, - packages=setuptools.find_packages(exclude=['ez_setup']) -) diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/__init__.py b/gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/bin/nfp-pecan b/gbpservice/tests/contrib/nfp_service/reference_configurator/bin/nfp-pecan index cecabd8edc..88498579f6 100644 --- a/gbpservice/tests/contrib/nfp_service/reference_configurator/bin/nfp-pecan +++ b/gbpservice/tests/contrib/nfp_service/reference_configurator/bin/nfp-pecan @@ -1,4 +1,3 @@ #!/bin/sh -script='/home/ubuntu/reference_configurator/api/config.py' -pecan serve $script & - +script='/usr/local/lib/python2.7/dist-packages/gbpservice/nfp/pecan/api/config.py' +pecan configurator_decider $script --mode base_with_vm & diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/config/pecan.service b/gbpservice/tests/contrib/nfp_service/reference_configurator/config/pecan.service index 5a334c3fcb..0e2a7cc8eb 100644 --- a/gbpservice/tests/contrib/nfp_service/reference_configurator/config/pecan.service +++ b/gbpservice/tests/contrib/nfp_service/reference_configurator/config/pecan.service @@ -5,7 +5,7 @@ After=network.target auditd.service [Service] Type=forking Restart=always -ExecStart=/home/ubuntu/reference_configurator/bin/nfp-pecan +ExecStart=/usr/local/lib/python2.7/dist-packages/gbpservice/tests/contrib/nfp_service/reference_configurator/bin/nfp-pecan KillMode=process Restart=on-failure diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/controllers/__init__.py b/gbpservice/tests/contrib/nfp_service/reference_configurator/controllers/__init__.py similarity index 100% rename from gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/controllers/__init__.py rename to gbpservice/tests/contrib/nfp_service/reference_configurator/controllers/__init__.py diff --git a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/controllers/controller.py b/gbpservice/tests/contrib/nfp_service/reference_configurator/controllers/controller.py similarity index 98% rename from gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/controllers/controller.py rename to gbpservice/tests/contrib/nfp_service/reference_configurator/controllers/controller.py index 882f696b0a..199c8edbb6 100644 --- a/gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/controllers/controller.py +++ b/gbpservice/tests/contrib/nfp_service/reference_configurator/controllers/controller.py @@ -27,8 +27,9 @@ SUCCESS = 'SUCCESS' notifications = [] -FW_SCRIPT_PATH = ("/home/ubuntu/reference_configurator/" + - "scripts/configure_fw_rules.py") +FW_SCRIPT_PATH = ("/usr/local/lib/python2.7/dist-packages/" + + "gbpservice/tests/contrib/nfp_service/" + + "reference_configurator/scripts/configure_fw_rules.py") class Controller(rest.RestController):