From: Adam Israel Date: Fri, 8 Mar 2019 23:33:35 +0000 (-0500) Subject: Fix bug 628 - Better handling of model management X-Git-Tag: v6.0.0~17 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=6d84dbd8746388114361e09300697da471de20ca;hp=6d84dbd8746388114361e09300697da471de20ca Fix bug 628 - Better handling of model management In order to address the issue raised in bug 628, we've improved the handling of how N2VC creates and destroys models. Previously this was done transparently, but now they are explicit operations that will need to be performed by the LCM. The LCM will be required to call `CreateNetworkService()` prior to calling `DeployCharms`. This will return True if successful, or raise an exception if the model can't be created. After LCM has called `RemoveCharms()`, it will need to call `DestroyNetworkService()` to remove the model from the Juju controller. - Fix lint errors - Implement the `DestroyNetworkService` method, which will destroy the model per Network Service, and any applications deployed to it. - Adds a new test for creating and deleting models - Add `CreateNetworkService` to explicitly create a new model for a Network Service. - Add proper return values from `logout()` so we can assert against it during tests - Add dependency on pytest-assume so we can test multiple failures per test. This allows us to properly assert and still tear down the juju client. - Use pytest.assume. If a method asserts, we can continue with the teardown of the client. Change-Id: I3031b008f4ed79f978ecd84ade72e125153729a7 Signed-off-by: Adam Israel ---