]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: make default command timeout field an int 55556/head
authorAdam King <adking@redhat.com>
Wed, 3 Jan 2024 13:35:05 +0000 (08:35 -0500)
committerAdam King <adking@redhat.com>
Mon, 12 Feb 2024 23:28:35 +0000 (18:28 -0500)
When the fields was "secs" instead, we could hit

Traceback (most recent call last):
  File "/usr/share/ceph/mgr/cephadm/serve.py", line 1380, in _run_cephadm_json
    out, err, code = await self._run_cephadm(
  File "/usr/share/ceph/mgr/cephadm/serve.py", line 1525, in _run_cephadm
    raise OrchestratorError(
orchestrator._interface.OrchestratorError: cephadm exited with an error code: 2, stderr: usage: cephadm
       [-h] [--image IMAGE] [--docker] [--data-dir DATA_DIR]
       [--log-dir LOG_DIR] [--logrotate-dir LOGROTATE_DIR]
       [--sysctl-dir SYSCTL_DIR] [--unit-dir UNIT_DIR] [--verbose]
       [--timeout TIMEOUT] [--retry RETRY] [--env ENV] [--no-container-init]
       [--no-cgroups-split]
       {version,pull,inspect-image, . . .
       ...
cephadm: error: argument --timeout: invalid int value: '295.0'

where the value ends up as a floating point value
after converting to a string (which is necessary to actually
pass it to the binary). By setting the field to be an
int, we should be able to avoid this.

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit e917d66838b2ea52538f4460d89d633ce7786067)
(cherry picked from commit d520af73b843d3406e4cfa6046f8c7af6552a22a)

src/pybind/mgr/cephadm/module.py

index 9ebe39ecd5cf981d6d3694eb6554e6eb23385bcb..13b665f4720dfa66e4663df4e48ec6439be535ef 100644 (file)
@@ -420,7 +420,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
         ),
         Option(
             'default_cephadm_command_timeout',
-            type='secs',
+            type='int',
             default=15 * 60,
             desc='Default timeout applied to cephadm commands run directly on '
             'the host (in seconds)'