Skip to content

Commit

Permalink
updating script to work with python3 (#1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
egmsft authored Dec 6, 2023
1 parent fb67753 commit d786eeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions playbooks/telegraf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@
mode: 0755
owner: telegraf
content: |
#!/usr/bin/env python
#!/usr/bin/env python3
import json
import subprocess
import sys
def sinfo():
for sinfo_line in subprocess.check_output(["/bin/sinfo", "-h", "-o", "%R %D %F %T"]).split('\n'):
for sinfo_line in subprocess.check_output(["/bin/sinfo", "-h", "-o", "%R %D %F %T"]).decode().split('\n'):
data = sinfo_line.split(' ')
if (data[0] != ''):
partition = data[0]
Expand All @@ -227,7 +227,7 @@
jobs_pending = 0
jobs_configuring = 0
jobs_other = 0
for sinfo_line in subprocess.check_output(["/bin/squeue", "-h", "-o", "%a %D %T %P"]).split('\n'):
for sinfo_line in subprocess.check_output(["/bin/squeue", "-h", "-o", "%a %D %T %P"]).decode().split('\n'):
data = sinfo_line.split(' ')
if (data[0] != ''):
account = data[0]
Expand Down

0 comments on commit d786eeb

Please sign in to comment.