summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6d84dbd)
This fixes bug 684, which noted that the workload message was not being
passed to the callback when removing charms.
This also fixes some lint errors and adds tear-down of the per-ns model
in integration tests
Change-Id: I83be9e3d951cf10a7479ea2e55074526403cf674
Signed-off-by: Adam Israel <adam.israel@canonical.com>
await self.disconnect_model(self.monitors[model_name])
await self.disconnect_model(self.monitors[model_name])
- # Notify the callback that this charm has been removed.
self.notify_callback(
model_name,
application_name,
"removed",
self.notify_callback(
model_name,
application_name,
"removed",
+ "Removing charm {}".format(application_name),
callback,
*callback_args,
)
callback,
*callback_args,
)
# Do not delete the default model. The default model was used by all
# Network Services, prior to the implementation of a model per NS.
# Do not delete the default model. The default model was used by all
# Network Services, prior to the implementation of a model per NS.
- if ns_uuid.lower() is "default":
+ if ns_uuid.lower() == "default":
return False
if not self.authenticated:
return False
if not self.authenticated:
try:
await self.controller.destroy_models(ns_uuid)
try:
await self.controller.destroy_models(ns_uuid)
raise NetworkServiceDoesNotExist(
"The Network Service '{}' does not exist".format(ns_uuid)
)
raise NetworkServiceDoesNotExist(
"The Network Service '{}' does not exist".format(ns_uuid)
)
)
subprocess.check_call(shlex.split(cmd))
)
subprocess.check_call(shlex.split(cmd))
- self.artifacts[charm] = {
- 'tmpdir': builds,
- 'charm': "{}/builds/{}".format(builds, charm),
- }
except subprocess.CalledProcessError as e:
except subprocess.CalledProcessError as e:
- raise Exception("charm build failed: {}.".format(e))
+ # charm build will return error code 100 if the charm fails
+ # the auto-run of charm proof, which we can safely ignore for
+ # our CI charms.
+ if e.returncode != 100:
+ raise Exception("charm build failed: {}.".format(e))
+
+ self.artifacts[charm] = {
+ 'tmpdir': builds,
+ 'charm': "{}/builds/{}".format(builds, charm),
+ }
return self.artifacts[charm]['charm']
return self.artifacts[charm]['charm']
+ await self.n2vc.DestroyNetworkService(self.ns_name)
# Need to wait for the charm to finish, because native charms
if self.state[application]['container']:
# Need to wait for the charm to finish, because native charms
if self.state[application]['container']:
Test N2VC's ssh key generation
"""
import n2vc
Test N2VC's ssh key generation
"""
import n2vc
import pytest
from . import base
import pytest
from . import base