From 0c865f7d21f9cca7ab89d29064b144697ffd848b Mon Sep 17 00:00:00 2001 From: Bart Wensley Date: Tue, 27 Nov 2018 20:24:50 -0600 Subject: [PATCH] Reconfigure VIM after application install When an application is successfully installed with armada, reconfigure the VIM so that it can manage the newly installed application (if necessary). This is done by doing a runtime application of the VIM's puppet manifest. Change-Id: Id43f633d0571fa328410fcf8392a172abadf0e4f Story: 2003910 Task: 27852 Signed-off-by: Bart Wensley --- puppet-manifests/src/modules/platform/manifests/nfv.pp | 1 + sysinv/sysinv/sysinv/sysinv/conductor/kube_app.py | 4 +++- sysinv/sysinv/sysinv/sysinv/conductor/manager.py | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/puppet-manifests/src/modules/platform/manifests/nfv.pp b/puppet-manifests/src/modules/platform/manifests/nfv.pp index 1b25aa3b48..f31db1a884 100644 --- a/puppet-manifests/src/modules/platform/manifests/nfv.pp +++ b/puppet-manifests/src/modules/platform/manifests/nfv.pp @@ -8,6 +8,7 @@ class platform::nfv::params ( class platform::nfv { include ::platform::params include ::platform::amqp::params + include ::platform::kubernetes::params group { 'nfv': ensure => 'present', diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/kube_app.py b/sysinv/sysinv/sysinv/sysinv/conductor/kube_app.py index 4851ada2a9..22c4608ac3 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/kube_app.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/kube_app.py @@ -602,6 +602,7 @@ class AppOperator(object): correct/update a previous manifest apply. :param rpc_app: application object in the RPC request + :return boolean: whether application apply was successful """ app = AppOperator.Application(rpc_app) @@ -649,12 +650,13 @@ class AppOperator(object): self._update_app_status(app, constants.APP_APPLY_SUCCESS) LOG.info("Application (%s) apply completed." % app.name) - return + return True except Exception as e: LOG.exception(e) # If it gets here, something went wrong self._abort_operation(app, constants.APP_APPLY_OP) + return False def perform_app_remove(self, rpc_app): """Process application remove request diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py index fe4d0c4dde..c4e892fa82 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py @@ -10401,7 +10401,13 @@ class ConductorManager(service.PeriodicService): :param rpc_app: data object provided in the rpc request """ - return self._app.perform_app_apply(rpc_app) + app_installed = self._app.perform_app_apply(rpc_app) + if app_installed: + # Update the VIM configuration as it may need to manage the newly + # installed application. + self._update_vim_config(context) + + return app_installed def perform_app_remove(self, context, rpc_app): """Handling of application removal request (via AppOperator)