]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: use the current cephadm binary for the agent 43514/head
authorMichael Fritch <mfritch@suse.com>
Mon, 11 Oct 2021 18:10:17 +0000 (12:10 -0600)
committerMichael Fritch <mfritch@suse.com>
Wed, 13 Oct 2021 02:48:56 +0000 (20:48 -0600)
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 <mfritch@suse.com>
src/cephadm/cephadm
src/pybind/mgr/cephadm/services/cephadmservice.py

index ed392bd187d75cb9eacabdafc5aaa72270631e48..95d9fbc246135cd8d3ab9291be7f36977d7c3b46 100755 (executable)
@@ -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
index f80bf34669d25128a29541eb42d3edbb37cd7d83..0cf78cb82a61b8f142de627980aee51665a2beda 100644 (file)
@@ -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,