diff --git a/ceph/utils.py b/ceph/utils.py index 99e444c..6b5e495 100644 --- a/ceph/utils.py +++ b/ceph/utils.py @@ -29,7 +29,6 @@ from datetime import datetime from charmhelpers.core import hookenv from charmhelpers.core import templating -from charmhelpers.core.decorators import retry_on_exception from charmhelpers.core.host import ( chownr, cmp_pkgrevno, @@ -1295,7 +1294,6 @@ def bootstrap_monitor_cluster(secret): path, done, init_marker) - _create_keyrings() except: raise finally: @@ -1343,10 +1341,11 @@ def _create_monitor(keyring, secret, hostname, path, done, init_marker): service_restart('ceph-mon-all') -@retry_on_exception(3, base_delay=5) -def _create_keyrings(): +def create_keyrings(): """Create keyrings for operation of ceph-mon units + NOTE: The quorum should be done before to execute this function. + :raises: Exception if keyrings cannot be created """ if cmp_pkgrevno('ceph', '14.0.0') >= 0: diff --git a/unit_tests/test_utils.py b/unit_tests/test_utils.py index f049f71..e3259c5 100644 --- a/unit_tests/test_utils.py +++ b/unit_tests/test_utils.py @@ -661,7 +661,6 @@ class CephTestCase(unittest.TestCase): utils.determine_packages()) @patch.object(utils, '_create_monitor') - @patch.object(utils, '_create_keyrings') @patch.object(utils, 'ceph_user') @patch.object(utils, 'os') @patch.object(utils, 'systemd') @@ -672,7 +671,6 @@ class CephTestCase(unittest.TestCase): mock_systemd, mock_os, mock_ceph_user, - mock_create_keyrings, mock_create_monitor): test_hostname = utils.socket.gethostname() test_secret = 'mysecret' @@ -701,7 +699,6 @@ class CephTestCase(unittest.TestCase): test_done, test_init_marker, ) - mock_create_keyrings.assert_called_once_with() mock_os.unlink.assert_called_with(test_keyring) @patch.object(utils, 'systemd') @@ -810,7 +807,7 @@ class CephTestCase(unittest.TestCase): call(['ceph-create-keys', '--id', test_hostname]) ) - utils._create_keyrings() + utils.create_keyrings() mock_check_call.assert_has_calls(test_calls)