remove unit from relation_set

This commit is contained in:
Edward Hope-Morley 2015-11-27 09:48:45 +00:00
parent dd4a7ac0fb
commit f8dd5395c3
2 changed files with 2 additions and 7 deletions

View File

@ -227,8 +227,7 @@ def update_rsync_acls():
settings = {'rsync_allowed_hosts': rsync_hosts,
'timestamp': time.time()}
for rid in relation_ids('swift-storage'):
for unit in related_units(rid):
relation_set(unit=unit, relation_id=rid, **settings)
relation_set(relation_id=rid, **settings)
@hooks.hook('swift-storage-relation-changed')

View File

@ -157,9 +157,5 @@ class SwiftHooksTestCase(unittest.TestCase):
mock_get_host_ip.side_effect = fake_get_host_ip
swift_hooks.update_rsync_acls()
calls = [call(rsync_allowed_hosts='10.0.0.1 10.0.0.2',
relation_id='storage:1',
unit='unit/0', timestamp=1234),
call(rsync_allowed_hosts='10.0.0.1 10.0.0.2',
relation_id='storage:1',
unit='unit/1', timestamp=1234)]
relation_id='storage:1', timestamp=1234)]
mock_rel_set.assert_has_calls(calls)