Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
0b8d796d
Commit
0b8d796d
authored
8 years ago
by
Chris Hines
Browse files
Options
Downloads
Patches
Plain Diff
change checkoutput to popen in subprocess calles due to old centos 6
parent
3102f178
No related branches found
No related tags found
1 merge request
!45
Provision slurm
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/provision_slurm/templates/provision_slurm.py.j2
+5
-2
5 additions, 2 deletions
roles/provision_slurm/templates/provision_slurm.py.j2
with
5 additions
and
2 deletions
roles/provision_slurm/templates/provision_slurm.py.j2
+
5
−
2
View file @
0b8d796d
...
@@ -45,14 +45,17 @@ def get_users(server):
...
@@ -45,14 +45,17 @@ def get_users(server):
def
mk_slurmaccount
(
acct
):
def
mk_slurmaccount
(
acct
):
output
=
subprocess
.
check_output
([
"
{{ slurm_dir }}/bin/sacctmgr
"
,
"
--noheader
"
,
"
list
"
,
"
account
"
,
acct
])
p
=
subprocess
.
Popen
([
"
{{ slurm_dir }}/bin/sacctmgr
"
,
"
--noheader
"
,
"
list
"
,
"
account
"
,
acct
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
(
output
,
error
)
=
p
.
communicate
()
if
acct
in
output
:
if
acct
in
output
:
return
return
else
:
else
:
subprocess
.
call
([
"
{{ slurm_dir }}/bin/sacctmgr
"
,
"
-i
"
,
"
create
"
,
"
account
"
,
acct
])
subprocess
.
call
([
"
{{ slurm_dir }}/bin/sacctmgr
"
,
"
-i
"
,
"
create
"
,
"
account
"
,
acct
])
def
mk_slurmuser
(
user
,
acct
):
def
mk_slurmuser
(
user
,
acct
):
output
=
subprocess
.
check_output
([
"
{{ slurm_dir }}/bin/sacctmgr
"
,
"
--noheader
"
,
"
list
"
,
"
Association
"
,
"
user=%s
"
%
user
,
"
format=account
"
])
p
=
subprocess
.
Popen
([
"
{{ slurm_dir }}/bin/sacctmgr
"
,
"
--noheader
"
,
"
list
"
,
"
Association
"
,
"
user=%s
"
%
user
,
"
format=account
"
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
(
output
,
error
)
=
p
.
communicate
()
if
acct
in
output
.
splitlines
():
if
acct
in
output
.
splitlines
():
return
return
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment