Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grid5000
reference-repository
Commits
6ab6e3a1
Commit
6ab6e3a1
authored
Apr 03, 2016
by
Jérémie Gaidamour
Browse files
[all] new input files: added grid5000.yaml
parent
92416f14
Changes
3
Hide whitespace changes
Inline
Side-by-side
dev/input/grid5000/grid5000.yaml
0 → 100644
View file @
6ab6e3a1
uid
:
grid5000
\ No newline at end of file
dev/lib/input_loader.rb
View file @
6ab6e3a1
...
...
@@ -32,6 +32,8 @@ def load_yaml_file_hierarchy(directory)
# Inject the file content into the global_hash, at the right place
path_hierarchy
=
File
.
dirname
(
filename
).
split
(
'/'
)
# Split the file path (path relative to input/)
path_hierarchy
=
[]
if
path_hierarchy
==
[
'.'
]
file_hash
=
Hash
.
from_array
(
path_hierarchy
,
file_hash
)
# Build the nested hash hierarchy according to the file path
global_hash
=
global_hash
.
deep_merge
(
file_hash
)
# Merge global_hash and file_hash. The value for entries with duplicate keys will be that of file_hash
...
...
dev/reference-api/reference-api.rb
View file @
6ab6e3a1
...
...
@@ -44,6 +44,19 @@ def net_switch_port_lookup(site, node_uid, interface='')
return
nil
end
#
# Write grid info
#
if
global_hash
[
'uid'
]
global_hash
[
"type"
]
=
"grid"
grid_path
=
Pathname
.
new
(
refapi_path
)
grid_path
.
mkpath
()
write_json
(
grid_path
.
join
(
"
#{
global_hash
[
'uid'
]
}
.json"
),
global_hash
.
reject
{
|
k
,
v
|
k
==
"sites"
})
end
global_hash
[
"sites"
].
each
do
|
site_uid
,
site
|
puts
site_uid
...
...
Write
Preview
Markdown
is supported
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