summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler/test_handler_lxd.py
diff options
context:
space:
mode:
authorParide Legovini <paride.legovini@canonical.com>2020-08-27 17:20:35 +0200
committerGitHub <noreply@github.com>2020-08-27 11:20:35 -0400
commit1f3a225af78dbfbff75c3faad28a5dc8cad0d1e3 (patch)
tree745122ff254494ef9cf38411e3aee3ad23800000 /tests/unittests/test_handler/test_handler_lxd.py
parent575750ac4a3abb6fdfa45e2cc65186df291d8ddf (diff)
downloadvyos-cloud-init-1f3a225af78dbfbff75c3faad28a5dc8cad0d1e3.tar.gz
vyos-cloud-init-1f3a225af78dbfbff75c3faad28a5dc8cad0d1e3.zip
LXD: detach network from profile before deleting it (#542)
* LXD: detach network from profile before deleting it When cleaning up the bridge network created by default by LXD as part of the `lxd init` process detach the network its profile before deleting it. LXD will otherwise refuse to delete it with error: Error: The network is currently in use. Discussion with LXD upstream: https://github.com/lxc/lxd/issues/7804. LP: #1776958 * LXD bridge deletion: fail if bridge exists but can't be deleted * LXD bridge deletion: remove useless failure logging
Diffstat (limited to 'tests/unittests/test_handler/test_handler_lxd.py')
-rw-r--r--tests/unittests/test_handler/test_handler_lxd.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unittests/test_handler/test_handler_lxd.py b/tests/unittests/test_handler/test_handler_lxd.py
index 21011204..b2181992 100644
--- a/tests/unittests/test_handler/test_handler_lxd.py
+++ b/tests/unittests/test_handler/test_handler_lxd.py
@@ -214,7 +214,7 @@ class TestLxdMaybeCleanupDefault(t_help.CiTestCase):
"""deletion of network should occur if create is True."""
cc_lxd.maybe_cleanup_default(
net_name=self.defnet, did_init=True, create=True, attach=False)
- m_lxc.assert_called_once_with(["network", "delete", self.defnet])
+ m_lxc.assert_called_with(["network", "delete", self.defnet])
@mock.patch("cloudinit.config.cc_lxd._lxc")
def test_device_removed_if_attach_true(self, m_lxc):