Fix bug 1467 93/10493/2
authorDavid Garcia <david.garcia@canonical.com>
Mon, 15 Mar 2021 17:41:34 +0000 (18:41 +0100)
committerDavid Garcia <david.garcia@canonical.com>
Mon, 15 Mar 2021 17:52:20 +0000 (18:52 +0100)
commitb0a8f409e149715bf37d30c414474888c8a499f3
tree6573b2c74b4d4beb74671ba3dfaaf7887add776d
parent435b86410c96c0e034a892ac5df9ebc9547e3b7d
Fix bug 1467

Do not raise exceptions in n2vc.libjuju.add_model() or n2vc.libjuju.destroy_model() functions

In general, functions should be as idempotent as possible. In this
particular case, executing the add_model() function several times with
the same arguments should just work. Same thing for destroy_model(). If
the model has already been destroyed, it should return and not give any
errors saying that the model doesn't exist.

Change-Id: I87e11ea0fe1b4063b2f89900fcc2bbf1f915b953
Signed-off-by: David Garcia <david.garcia@canonical.com>
n2vc/libjuju.py
n2vc/tests/unit/test_libjuju.py