NFP - Context support in Proxy Agent

Added support to utilize NFP context supported
by nfp/core. Initializes context with default
values in all external functions which are invoked
by rpcs.

Change-Id: Iac0c02bc229e2127f170e952782017eb4ac34f79
Partial-Bug: 1668198
This commit is contained in:
mak-454 2017-04-18 18:12:08 +05:30 committed by Subrahmanyam Ongole
parent 8e5f5ae865
commit 683f860306
2 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,6 @@
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-120} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./gbpservice/neutron/tests/unit/nfp/orchestrator} $LISTOPT $IDOPTION
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./gbpservice/neutron/tests/unit/nfp/proxy_agent} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from gbpservice.nfp.core import context as module_context
from gbpservice.nfp.core import log as nfp_logging
from gbpservice.nfp.core.rpc import RpcAgent
from gbpservice.nfp.lib import transport as transport
@ -52,6 +53,7 @@ class RpcHandler(object):
"""Method of rpc handler for create_network_function_config.
Return: Http Response.
"""
module_context.init()
transport.send_request_to_configurator(self._conf,
context, body,
"CREATE")
@ -61,6 +63,7 @@ class RpcHandler(object):
"""Method of rpc handler for delete_network_function_config.
Return: Http Response.
"""
module_context.init()
transport.send_request_to_configurator(self._conf,
context, body,
"DELETE")
@ -70,6 +73,7 @@ class RpcHandler(object):
"""Method of rpc handler for delete_network_function_config.
Return: Http Response.
"""
module_context.init()
transport.send_request_to_configurator(self._conf,
context, body,
"UPDATE")
@ -79,6 +83,7 @@ class RpcHandler(object):
"""Method of rpc handler for create_network_function_device_config.
Return: Http Response.
"""
module_context.init()
transport.send_request_to_configurator(self._conf,
context, body,
"CREATE",
@ -89,6 +94,7 @@ class RpcHandler(object):
"""Method of rpc handler for delete_network_function_device_config.
Return: Http Response.
"""
module_context.init()
transport.send_request_to_configurator(self._conf,
context, body,
"DELETE",
@ -99,6 +105,7 @@ class RpcHandler(object):
"""Method of rpc handler for create_service.
Return: Http Response.
"""
module_context.init()
transport.send_request_to_configurator(self._conf,
context, body,
"CREATE",