def test_configure_pacemaker_remote_duplicate(self, commit, is_resource_present): is_resource_present.return_value = True self.assertEqual( utils.configure_pacemaker_remote( 'juju-aa0ba5-zaza-ed2ce6f303f0-10.maas', '10.0.0.10'), 'juju-aa0ba5-zaza-ed2ce6f303f0-10') self.assertFalse(commit.called)
def test_configure_pacemaker_remote(self, commit, is_resource_present): is_resource_present.return_value = False self.assertEqual( utils.configure_pacemaker_remote( 'juju-aa0ba5-zaza-ed2ce6f303f0-10', '10.0.0.10'), 'juju-aa0ba5-zaza-ed2ce6f303f0-10') commit.assert_called_once_with( 'crm configure primitive juju-aa0ba5-zaza-ed2ce6f303f0-10 ' 'ocf:pacemaker:remote params ' 'server=10.0.0.10 ' 'reconnect_interval=60 op monitor interval=30s', failure_is_fatal=True)