Skip to content

Commit bf6b582

Browse files
committed
loop devices: requires that all devices have correct label
1 parent 651fdd6 commit bf6b582

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ceph_devstack/resources/ceph/containers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,15 @@ def create_cmd(self):
240240
@property
241241
def additional_volumes(self):
242242
volumes = []
243-
if DEFAULT_CONFIG_PATH.parent.joinpath("sshd_config").exists():
243+
if (
244+
sshd_config := DEFAULT_CONFIG_PATH.parent.joinpath(
245+
"sshd_config"
246+
).expanduser()
247+
) and sshd_config.exists():
244248
volumes.extend(
245249
[
246250
"-v",
247-
f"{DEFAULT_CONFIG_PATH.parent.joinpath('sshd_config')}:/etc/ssh/sshd_config.d/teuthology.conf:z",
251+
f"{sshd_config}:/etc/ssh/sshd_config.d/teuthology.conf:z",
248252
]
249253
)
250254
return volumes
@@ -304,6 +308,7 @@ async def create_loop_device(self, device: str):
304308
check=True,
305309
)
306310
await self.cmd(["sudo", "losetup", device, loop_img_name], check=True)
311+
await self.cmd(["chcon", "-t", "fixed_disk_device_t", device])
307312

308313
async def remove_loop_device(self, device: str):
309314
loop_img_name = os.path.join(self.loop_img_dir, self.device_image(device))

0 commit comments

Comments
 (0)