Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Sep 4, 2024
1 parent 8248550 commit 70cdf49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ def configure_ceph_cli(self) -> None:

def ceph_cli(self, *args: str, timeout: int = 60) -> str:
"""Run Ceph CLI command"""
cmd = ["/usr/bin/ceph", "--conf", str(ceph_config_file()), "--user", self.app.name, *args]
conf = ceph_config_file().absolute().as_posix()
cmd = ["/usr/bin/ceph", "--conf", conf, "--user", self.app.name, *args]
return subprocess.check_output(cmd, timeout=timeout).decode("UTF-8")

@lru_cache(maxsize=None)
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ def test_ceph_context_getter(check_output, harness, ceph_conf_directory):
}

assert harness.charm.ceph_context == expected_context
conf_file = str(ceph_conf_directory() / "ceph.conf")
conf = (ceph_conf_directory() / "ceph.conf").absolute().as_posix()
check_output.assert_any_call(
["/usr/bin/ceph", "--conf", conf_file, "--user", "ceph-csi", "fsid"], timeout=60
["/usr/bin/ceph", "--conf", conf, "--user", "ceph-csi", "fsid"], timeout=60
)
check_output.assert_any_call(
["/usr/bin/ceph", "--conf", conf_file, "--user", "ceph-csi", "fs", "ls", "-f", "json"],
["/usr/bin/ceph", "--conf", conf, "--user", "ceph-csi", "fs", "ls", "-f", "json"],
timeout=60,
)

Expand Down

0 comments on commit 70cdf49

Please sign in to comment.