Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ceph_cfg/mds.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ def update(self):

def prepare(self):
self.service_available()
path_bootstrap_keyring = keyring._get_path_keyring_mds(self.model.cluster_name)
if not os.path.isfile(path_bootstrap_keyring):
raise Error("Keyring not found at %s" % (path_bootstrap_keyring))
if not os.path.isdir(self.model.path_systemd_env):
log.info("mkdir %s" % (self.model.path_systemd_env))
os.makedirs(self.model.path_systemd_env)
Expand Down
7 changes: 5 additions & 2 deletions ceph_cfg/mon.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,11 @@ def create(self, **kwargs):
)
path_mon_dir = constants._path_ceph_lib_mon + path_mon_dir_postfix
path_done_file = path_mon_dir + "/done"
path_admin_keyring = keyring._get_path_keyring_admin(self.model.cluster_name)
keyring_path_mon = keyring._get_path_keyring_mon(self.model.cluster_name)
keyring_facard = keyring.keyring_facard(self.model)
keyring_facard.key_type = "admin"
path_admin_keyring = keyring_facard.keyring_path_get()
keyring_facard.key_type = "mon"
keyring_path_mon = keyring_facard.keyring_path_get()

if os.path.isfile(path_done_file):
log.debug("Mon done file exists:%s" % (path_done_file))
Expand Down
8 changes: 5 additions & 3 deletions ceph_cfg/osd.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,11 @@ def prepare(self, **kwargs):
raise Error("osd_dev not specified")

# Check boot strap key exists
bootstrap_path_osd = keyring._get_path_keyring_osd(cluster_name)
if not os.path.isfile(bootstrap_path_osd):
raise Error(bootstrap_path_osd)
keyring_facard = keyring.keyring_facard(self.model)
keyring_facard.key_type = "osd"
if not keyring_facard.present():
bootstrap_path_osd = keyring_facard.keyring_path_get()
raise Error("Keyring not found at %s" % (bootstrap_path_osd))
if not os.path.isdir(constants._path_ceph_lib_osd):
log.info("mkdir %s")
os.makedirs(constants._path_ceph_lib_osd)
Expand Down
3 changes: 3 additions & 0 deletions ceph_cfg/rados_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ def keyring_service_create(self):
log.info("Make missing keyring:%s" % (self.keyring_service_path))
keyringobj = keyring.keyring_facard(self.model)
keyringobj.key_type = self.bootstrap_keyring_type
if not keyringobj.present():
path_bootstrap_keyring = keyringobj.keyring_path_get()
raise Error("Keyring not found at %s" % (path_bootstrap_keyring))
oldmask = os.umask(int('077', 8))
try:
try:
Expand Down
3 changes: 0 additions & 3 deletions ceph_cfg/rgw.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ def prepare(self):
raise Error("rgw name must start with 'rgw.'")
self.service_available()
self._set_rgw_path_lib()
path_bootstrap_keyring = keyring._get_path_keyring_rgw(self.model.cluster_name)
if not os.path.isfile(path_bootstrap_keyring):
raise Error("Keyring not found at %s" % (path_bootstrap_keyring))
if not os.path.isdir(self.rgw_path_lib):
log.info("Make missing directory:%s" % (self.rgw_path_lib))
os.makedirs(self.rgw_path_lib)
Expand Down