Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grid5000
reference-repository
Commits
7cfd57f2
Commit
7cfd57f2
authored
Apr 28, 2016
by
Jérémie Gaidamour
Browse files
[dev] oar-properties.rb convert boolean and float to string
parent
3db7ba9c
Changes
1
Show whitespace changes
Inline
Side-by-side
generators/oar-properties/lib/lib-oar-properties.rb
View file @
7cfd57f2
...
@@ -97,6 +97,17 @@ def get_node_properties(cluster_uid, cluster, node_uid, node)
...
@@ -97,6 +97,17 @@ def get_node_properties(cluster_uid, cluster, node_uid, node)
h
[
'max_walltime'
]
=
0
# default
h
[
'max_walltime'
]
=
0
# default
h
[
'max_walltime'
]
=
node
[
'supported_job_types'
][
'max_walltime'
]
if
node
[
'supported_job_types'
]
&&
node
[
'supported_job_types'
].
has_key?
(
'max_walltime'
)
h
[
'max_walltime'
]
=
node
[
'supported_job_types'
][
'max_walltime'
]
if
node
[
'supported_job_types'
]
&&
node
[
'supported_job_types'
].
has_key?
(
'max_walltime'
)
# convert booleans to YES/NO string
h
.
each
{
|
k
,
v
|
if
v
==
true
h
[
k
]
=
'YES'
elsif
v
==
false
h
[
k
]
=
'NO'
elsif
v
.
is_a?
Float
h
[
k
]
=
"
#{
v
}
"
end
}
return
h
return
h
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment