From: Michael Fritch Date: Mon, 11 Oct 2021 18:10:17 +0000 (-0600) Subject: cephadm: use the current cephadm binary for the agent X-Git-Tag: v17.1.0~649^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e6a50baeb37831bbd09cea7cc71428c47c5bbaa;p=ceph.git cephadm: use the current cephadm binary for the agent 78983ad0d0cc introduced passing the cephadm binary via config json, when the currently deployed cephadm binary could be used in the agent's unit.run file instead Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index ed392bd187d7..95d9fbc24613 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3505,7 +3505,7 @@ class CephadmAgent(): loop_interval = 30 stop = False - required_files = ['cephadm', 'agent.json', 'keyring'] + required_files = ['agent.json', 'keyring'] def __init__(self, ctx: CephadmContext, fsid: str, daemon_id: Union[int, str] = ''): self.ctx = ctx @@ -3515,7 +3515,6 @@ class CephadmAgent(): self.target_port = '' self.host = '' self.daemon_dir = os.path.join(ctx.data_dir, self.fsid, f'{self.daemon_type}.{self.daemon_id}') - self.binary_path = os.path.join(self.daemon_dir, 'cephadm') self.config_path = os.path.join(self.daemon_dir, 'agent.json') self.keyring_path = os.path.join(self.daemon_dir, 'keyring') self.ca_path = os.path.join(self.daemon_dir, 'root_cert.pem') @@ -3559,7 +3558,8 @@ class CephadmAgent(): def unit_run(self) -> str: py3 = shutil.which('python3') - return ('set -e\n' + f'{py3} {self.binary_path} agent --fsid {self.fsid} --daemon-id {self.daemon_id} &\n') + binary_path = os.path.realpath(sys.argv[0]) + return ('set -e\n' + f'{py3} {binary_path} agent --fsid {self.fsid} --daemon-id {self.daemon_id} &\n') def unit_file(self) -> str: return """#generated by cephadm diff --git a/src/pybind/mgr/cephadm/services/cephadmservice.py b/src/pybind/mgr/cephadm/services/cephadmservice.py index f80bf34669d2..0cf78cb82a61 100644 --- a/src/pybind/mgr/cephadm/services/cephadmservice.py +++ b/src/pybind/mgr/cephadm/services/cephadmservice.py @@ -1036,7 +1036,6 @@ class CephadmAgent(CephService): self.mgr.inventory.get_addr(daemon_spec.host)) config = { 'agent.json': json.dumps(cfg), - 'cephadm': self.mgr._cephadm, 'keyring': daemon_spec.keyring, 'root_cert.pem': self.mgr.cherrypy_thread.ssl_certs.get_root_cert(), 'listener.crt': listener_cert,