|
| 1 | +######################################################################### |
| 2 | +# slurmctld/enums.pyx - pyslurm slurmctld enums |
| 3 | +######################################################################### |
| 4 | +# Copyright (C) 2025 Toni Harzendorf <[email protected]> |
| 5 | +# |
| 6 | +# This file is part of PySlurm |
| 7 | +# |
| 8 | +# PySlurm is free software; you can redistribute it and/or modify |
| 9 | +# it under the terms of the GNU General Public License as published by |
| 10 | +# the Free Software Foundation; either version 2 of the License, or |
| 11 | +# (at your option) any later version. |
| 12 | + |
| 13 | +# PySlurm is distributed in the hope that it will be useful, |
| 14 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | +# GNU General Public License for more details. |
| 17 | +# |
| 18 | +# You should have received a copy of the GNU General Public License along |
| 19 | +# with PySlurm; if not, write to the Free Software Foundation, Inc., |
| 20 | +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 21 | +# |
| 22 | +# cython: c_string_type=unicode, c_string_encoding=default |
| 23 | +# cython: language_level=3 |
| 24 | + |
| 25 | +from enum import IntEnum |
| 26 | + |
| 27 | +class ShutdownMode(IntEnum): |
| 28 | + """Mode of operation for shutdown action.""" |
| 29 | + ALL = 0 |
| 30 | + CORE_FILE = 1 |
| 31 | + CONTROLLER_ONLY = 2 |
| 32 | + |
| 33 | + |
| 34 | +# A bit hacky, but it works for now. Putting the docstring under the enum value |
| 35 | +# does not work unfortunately. |
| 36 | +ShutdownMode.ALL.__doc__ = "Shutdown all daemons (slurmctld and slurmd)" |
| 37 | +ShutdownMode.CORE_FILE.__doc__ = "Shutdown only slurmctld, and create a coredump" |
| 38 | +ShutdownMode.CONTROLLER_ONLY.__doc__ = "Shutdown only slurmctld, without a coredump" |
0 commit comments