cephadm: remove injected_args#39619
Conversation
|
replaces #37495 |
|
jenkins test make check |
25bf6a8 to
f7c829e
Compare
| path = os.path.realpath(__file__) | ||
| assert os.path.isfile(path) | ||
| return path |
|
f7c829e to
40b2962
Compare
|
changelog: fix cephadm tox |
| ['mkdir', '-p', f'/var/lib/ceph/{self.mgr._cluster_fsid}']) | ||
| if code: | ||
| msg = f"Unable to deploy the cephadm binary to {host}: {_err}" | ||
| self.log.warning(msg) |
There was a problem hiding this comment.
maybe this kind of situations and the consequences deserves an "error" instead of a "warning"
mgfritch
left a comment
There was a problem hiding this comment.
lgtm! .. mostly nits around readability of the remoto connection handling, but the code is correct
| out, err, code = remoto.process.check( | ||
| conn, | ||
| [python, self.mgr.cephadm_binary_path] + final_args, | ||
| stdin=stdin.encode('utf-8') if stdin is not None else None) |
There was a problem hiding this comment.
(nit) the remoto.process logic and the logic above are duplicates .. move into a helper func?
| if code == 2: | ||
| out_ls, err_ls, code_ls = remoto.process.check( | ||
| conn, ['ls', self.mgr.cephadm_binary_path]) | ||
| if code_ls == 2: |
There was a problem hiding this comment.
| if code_ls == 2: | |
| if code_ls != 0: |
(nit) similar, but maybe any non-zero errcode?
Might also be good to extract this into a dedicated cephadm_binary_exists function?
| stdin=script.encode('utf-8')) | ||
| [python, self.mgr.cephadm_binary_path] + final_args, | ||
| stdin=stdin.encode('utf-8') if stdin is not None else None) | ||
| if code == 2: |
There was a problem hiding this comment.
| if code == 2: | |
| if code == errno.ENOENT: |
(nit) I was somewhat confused why retval 2, but it's file not found from python.
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
right now, an upgrade might overwrite the existing binary which would force us to have the CLI stable. Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Removed the injected_argv parameter and the injection of code in the cephadm script we send to hosts. Now the script is copied and after that we execute the cephadm command. I would like to copy it only one time (when adding new hosts) but this will be part of a future PR, together with other prs to: - Introduce cephadm version - Get rid of packaged/root mode - Use pex or eggs Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com> Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Avoid copying cephadm all the time. Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Because we now always have a script on the remote hosts. Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
40b2962 to
c40436e
Compare
|
jenkins test make check |
This PR is based on #39141 and will contain those commits, unit it is merged
Avoid copying cephadm all the time.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox