Fix action replay for clear-knownhost-cache

The return key was illegal in Juju, so this patchset makes
it legal.

Change-Id: I2ee633ba0b445025a789a77e62950cd572636c6c
Partial-Bug: #1860743
(cherry picked from commit 67dfc8d882)
This commit is contained in:
Alex Kavanagh 2020-02-07 14:57:02 +00:00 committed by Alex Kavanagh (tinwood)
parent 0cee970ff9
commit aa8670b427
2 changed files with 4 additions and 4 deletions

View File

@ -63,7 +63,7 @@ def clear_unit_knownhost_cache(args):
"""
target = hookenv.action_get('target')
hookenv.action_set({
"Units updated": clear_knownhost_cache(target)
"units-updated": clear_knownhost_cache(target)
})

View File

@ -101,7 +101,7 @@ class ClearUnitKnownhostCacheTestCase(CharmTestCase):
self.action_get.return_value = 'aservice/2'
actions.clear_unit_knownhost_cache([])
self.action_set.assert_called_once_with({
"Units updated": [{'aservice/2': '10.0.0.2'}]
"units-updated": [{'aservice/2': '10.0.0.2'}]
})
self.clear_hostset_cache_for.assert_called_once_with('10.0.0.2')
self.update_ssh_key.assert_called_once_with(rid="r:1",
@ -113,7 +113,7 @@ class ClearUnitKnownhostCacheTestCase(CharmTestCase):
self.action_get.return_value = 'bservice'
actions.clear_unit_knownhost_cache([])
self.action_set.assert_called_once_with({
"Units updated": [
"units-updated": [
{'bservice/1': '10.0.1.1'},
{'bservice/2': '10.0.1.2'},
{'bservice/3': '10.0.1.3'},
@ -134,7 +134,7 @@ class ClearUnitKnownhostCacheTestCase(CharmTestCase):
self.action_get.return_value = ''
actions.clear_unit_knownhost_cache([])
self.action_set.assert_called_once_with({
"Units updated": [
"units-updated": [
{'aservice/1': '10.0.0.1'},
{'aservice/2': '10.0.0.2'},
{'aservice/3': '10.0.0.3'},