Skip to content

Conversation

rezib
Copy link
Contributor

@rezib rezib commented Nov 25, 2021

When it is defined, the mcs_label on nodes are bytes:

# python3
Python 3.6.8 (default, Dec  5 2019, 15:45:45)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyslurm
>>> pyslurm.node().get()['cn1']['mcs_label']
b'label'
>>> type(pyslurm.node().get()['cn1']['mcs_label'])
<class 'bytes'>

With this commit, it is converted to a unicode string for easier handling by consumer.

Seen with Slurm 20.02.2 and custom version of pyslurm, but patch applies on current main branch.

When it is defined, the mcs_label on nodes are bytes:

  # python3
  Python 3.6.8 (default, Dec  5 2019, 15:45:45)
  [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import pyslurm
  >>> pyslurm.node().get()['cn1']['mcs_label']
  b'label'
  >>> type(pyslurm.node().get()['cn1']['mcs_label'])
  <class 'bytes'>

With this commit, it is converted to a unicode string for easier
handling by consumer.
Copy link
Member

@giovtorres giovtorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼 Thank you for this contribution!

@giovtorres giovtorres merged commit 6f49056 into PySlurm:main Nov 25, 2021
@rezib
Copy link
Contributor Author

rezib commented Nov 25, 2021

My pleasure, thank you @giovtorres for merging it!

@rezib rezib deleted the pr-mcslabel-str branch November 25, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants