Merge pull request from mgfritch/cephadm-agent-binary

cephadm: use the current cephadm binary for the agent

Reviewed-by: Adam King <adking@redhat.com>
This commit is contained in:
Sebastian Wagner 2021-10-19 13:33:43 +02:00 committed by GitHub
commit a755ffa678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions
src
cephadm
pybind/mgr/cephadm/services

View File

@ -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

View 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,