Skip to content

Job.to_dict fails if GID can't be resolved #417

Description

@mrvn

Some groups where removed from LDAP by accident so their name can no longer be resolved. This causes pyslurm to crash:

  File "pyslurm/xcollections.pyx", line 460, in pyslurm.xcollections.MultiClusterMap.to_dict
  File "pyslurm/xcollections.pyx", line 620, in pyslurm.xcollections.multi_dict_recursive
  File "pyslurm/xcollections.pyx", line 609, in pyslurm.xcollections.dict_recursive
  File "pyslurm/core/job/job.pyx", line 341, in pyslurm.core.job.job.Job.to_dict
  File "pyslurm/utils/helpers.pyx", line 335, in pyslurm.utils.helpers.instance_to_dict
  File "pyslurm/core/job/job.pyx", line 706, in pyslurm.core.job.job.Job.group_name.__get__
  File "pyslurm/utils/helpers.pyx", line 69, in pyslurm.utils.helpers.gid_to_name
  File "pyslurm/utils/helpers.pyx", line 87, in pyslurm.utils.helpers.gid_to_name
  File "pyslurm/utils/helpers.pyx", line 83, in pyslurm.utils.helpers.gid_to_name
KeyError: 'getgrgid(): gid not found: 2002'

This should fall back to reporting the numerical value of the group.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions