]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cephadm: don't use ctx.fsid for clean_cgroup
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 28 Jul 2021 20:52:05 +0000 (16:52 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:32:15 +0000 (16:32 +0200)
commit33789d7fab35c85b9001c3f84ed9fbfd8da08dfa
tree93134678bcf9cfb4543077f8b2424b9830be32be
parentb985d6cb4d3e73a332e1c22c053752df98d14e2a
cephadm: don't use ctx.fsid for clean_cgroup

The clean_cgroup method assumes that the ctx.fsid is set while this is
true for the bootstrap command, it isn't set for adopt or deploy commands
(and maybe others).

This ends up to the adopt command to fails:

Traceback (most recent call last):
  File "/sbin/cephadm", line 8301, in <module>
    main()
  File "/sbin/cephadm", line 8289, in main
    r = ctx.func(ctx)
  File "/sbin/cephadm", line 1764, in _default_image
    return func(ctx)
  File "/sbin/cephadm", line 5091, in command_adopt
    command_adopt_ceph(ctx, daemon_type, daemon_id, fsid)
  File "/sbin/cephadm", line 5299, in command_adopt_ceph
    osd_fsid=osd_fsid)
  File "/sbin/cephadm", line 2884, in deploy_daemon_units
    clean_cgroup(ctx, unit_name)
  File "/sbin/cephadm", line 2724, in clean_cgroup
    if not ctx.fsid:
  File "/sbin/cephadm", line 155, in __getattr__
    return super().__getattribute__(name)
AttributeError: 'CephadmContext' object has no attribute 'fsid'

Since we already have the fsid value in deploy_daemon_units (which calls
clean_cgroup) then we can pass the fsid value directly.

This fixes a regression introduced by 1fee255

Fixes: https://tracker.ceph.com/issues/51902
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 3907ce7d6e091f87c3bd4437d13951ee838dc02b)
src/cephadm/cephadm