list-disks action throws an exception on on bionic/train

Bug #1860339 reported by Chris MacNaughton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph OSD Charm
Triaged
Medium
Unassigned

Bug Description

juju run-action ceph-osd/leader list-disks --wait
unit-ceph-osd-2:
  UnitId: ceph-osd/2
  id: "26"
  message: exit status 1
  results:
    ReturnCode: 1
    Stderr: |
      Traceback (most recent call last):
        File "/var/lib/juju/agents/unit-ceph-osd-2/charm/actions/list-disks", line 39, in <module>
          import ceph.utils
        File "lib/ceph/utils.py", line 32, in <module>
          from charmhelpers.core.host import (
      ImportError: cannot import name 'owner'
  status: failed

Andrew McLeod (admcleod)
Changed in charm-ceph-osd:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
nikhil kshirsagar (nkshirsagar) wrote :

This does not reproduce when I tried,

ubuntu@nkshirsagar-bastion:~/stsstack-bundles/ceph$ ./generate-bundle.sh -s bionic -r train -n bionic-train-ceph --run
Creating Juju model bionic-train-ceph
...
<snip>

ubuntu@nkshirsagar-bastion:~/stsstack-bundles/ceph$ juju run-action ceph-osd/leader list-disks --wait
unit-ceph-osd-0:
  UnitId: ceph-osd/0
  id: "2"
  results:
    blacklist: '[]'
    disks: '[''/dev/vdb'']'
    non-pristine: '[]'
  status: completed
  timing:
    completed: 2021-08-18 13:00:31 +0000 UTC
    enqueued: 2021-08-18 13:00:30 +0000 UTC
    started: 2021-08-18 13:00:31 +0000 UTC

/var/lib/juju/agents/unit-ceph-osd-0/charm/hooks/charmhelpers/core/host.py does have

def owner(path):
    """Returns a tuple containing the username & groupname owning the path.

    :param str path: the string path to retrieve the ownership
    :return tuple(str, str): A (username, groupname) tuple containing the
                             name of the user and group owning the path.
    :raises OSError: if the specified path does not exist
    """
    stat = os.stat(path)
    username = pwd.getpwuid(stat.st_uid)[0]
    groupname = grp.getgrgid(stat.st_gid)[0]
    return username, groupname

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.