ident_dict = {
'admin' : 'client.admin',
'mds' : 'client.bootstrap-mds',
+ 'mgr' : 'client.bootstrap-mgr',
'osd' : 'client.bootstrap-osd',
'rgw' : 'client.bootstrap-rgw',
'mon' : 'mon.'
'mds' : [
'mon', 'allow profile bootstrap-mds'
],
+ 'mgr' : [
+ 'mon', 'allow profile bootstrap-mgr'
+ ],
'osd' : [
'mon', 'allow profile bootstrap-osd'
],
if not mon_number in mon_quorum:
rlogger.error("Not yet quorum for '%s'", host)
return False
- for keytype in ["admin", "mds", "osd", "rgw"]:
+ for keytype in ["admin", "mds", "mgr", "osd", "rgw"]:
if not gatherkeys_missing(args, distro, rlogger, path_keytype_mon, keytype, dest_dir):
# We will return failure if we fail to gather any key
rlogger.error("Failed to return '%s' key from host %s", keytype, host)
raise RuntimeError('Failed to connect any mon')
had_error = False
date_string = time.strftime("%Y%m%d%H%M%S")
- for keytype in ["admin", "mds", "mon", "osd", "rgw"]:
+ for keytype in ["admin", "mds", "mgr", "mon", "osd", "rgw"]:
filename = keytype_path_to(args, keytype)
tmp_path = os.path.join(tmpd, filename)
if not os.path.exists(tmp_path):
def mock_get_keys_sucess_static(args, host, dest_dir):
- for keytype in ["admin", "mon", "osd", "mds", "rgw"]:
+ for keytype in ["admin", "mon", "osd", "mds", "mgr", "rgw"]:
keypath = gatherkeys.keytype_path_to(args, keytype)
path = "%s/%s" % (dest_dir, keypath)
get_key_static(keytype, path)
def mock_get_keys_sucess_dynamic(args, host, dest_dir):
- for keytype in ["admin", "mon", "osd", "mds", "rgw"]:
+ for keytype in ["admin", "mon", "osd", "mds", "mgr", "rgw"]:
keypath = gatherkeys.keytype_path_to(args, keytype)
path = "%s/%s" % (dest_dir, keypath)
get_key_dynamic(keytype, path)
dir_content = os.listdir(self.test_dir)
assert "ceph.client.admin.keyring" in dir_content
assert "ceph.bootstrap-mds.keyring" in dir_content
+ assert "ceph.bootstrap-mgr.keyring" in dir_content
assert "ceph.mon.keyring" in dir_content
assert "ceph.bootstrap-osd.keyring" in dir_content
assert "ceph.bootstrap-rgw.keyring" in dir_content
- assert len(dir_content) == 5
+ assert len(dir_content) == 6
# Now we repeat as no new keys are generated
gatherkeys.gatherkeys(args)
dir_content = os.listdir(self.test_dir)
- assert len(dir_content) == 5
+ assert len(dir_content) == 6
@mock.patch('ceph_deploy.gatherkeys.time.strftime', mock_time_strftime)
@mock.patch('ceph_deploy.gatherkeys.gatherkeys_with_mon', mock_get_keys_sucess_dynamic)
def test_gatherkeys_backs_up(self):
"""
- Test 'gatherkeys' succeeds when getinig keys that are always different.
+ Test 'gatherkeys' succeeds when getting keys that are always different.
Test 'gatherkeys' does backup keys that are not identical.
"""
args = mock.Mock()
dir_content = os.listdir(self.test_dir)
assert "ceph.client.admin.keyring" in dir_content
assert "ceph.bootstrap-mds.keyring" in dir_content
+ assert "ceph.bootstrap-mgr.keyring" in dir_content
assert "ceph.mon.keyring" in dir_content
assert "ceph.bootstrap-osd.keyring" in dir_content
assert "ceph.bootstrap-rgw.keyring" in dir_content
- assert len(dir_content) == 5
+ assert len(dir_content) == 6
# Now we repeat as new keys are generated and old
# are backed up
gatherkeys.gatherkeys(args)
mocked_time = mock_time_strftime(None)
assert "ceph.client.admin.keyring" in dir_content
assert "ceph.bootstrap-mds.keyring" in dir_content
+ assert "ceph.bootstrap-mgr.keyring" in dir_content
assert "ceph.mon.keyring" in dir_content
assert "ceph.bootstrap-osd.keyring" in dir_content
assert "ceph.bootstrap-rgw.keyring" in dir_content
assert "ceph.client.admin.keyring-%s" % (mocked_time) in dir_content
assert "ceph.bootstrap-mds.keyring-%s" % (mocked_time) in dir_content
+ assert "ceph.bootstrap-mgr.keyring-%s" % (mocked_time) in dir_content
assert "ceph.mon.keyring-%s" % (mocked_time) in dir_content
assert "ceph.bootstrap-osd.keyring-%s" % (mocked_time) in dir_content
assert "ceph.bootstrap-rgw.keyring-%s" % (mocked_time) in dir_content
- assert len(dir_content) == 10
+ assert len(dir_content) == 12