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
148e4a81
Commit
148e4a81
authored
Nov 16, 2018
by
Lucas Nussbaum
Browse files
[dev] introduce get_sites convenience method
parent
e39d7383
Changes
4
Hide whitespace changes
Inline
Side-by-side
Rakefile
View file @
148e4a81
...
...
@@ -13,7 +13,7 @@ VALIDATORS_DIR = "./generators/input-validators"
WIKI_DIR
=
"./generators/wiki"
# Get the list of sites as the list of directories in input/grid5000/sites
G5K_SITES
=
(
Dir
::
entries
(
'input/grid5000/sites'
)
-
[
'.'
,
'..'
]).
sort
G5K_SITES
=
RefRepo
::
Utils
::
get_sites
namespace
:puppet
do
...
...
lib/refrepo/gen/wiki/mw_utils.rb
View file @
148e4a81
...
...
@@ -114,7 +114,7 @@ module G5K
return
Marshal
.
load
(
Marshal
.
dump
(
@@global_hash
))
end
SITES
=
get_global_hash
[
'sites'
].
keys
.
sort
SITES
=
RefRepo
::
Utils
::
get_sites
end
#Defines MediaWiki helpers
...
...
lib/refrepo/utils.rb
View file @
148e4a81
...
...
@@ -17,6 +17,10 @@ module RefRepo::Utils
d
=
open
(
"
#{
conf
[
'uri'
]
}
/
#{
conf
[
'version'
]
}
/
#{
path
}
"
,
o
).
read
return
JSON
::
parse
(
d
)
end
def
self
.
get_sites
return
(
Dir
::
entries
(
'input/grid5000/sites'
)
-
[
'.'
,
'..'
]).
sort
end
end
# Various monkey patches
...
...
lib/refrepo/valid/oar-properties.rb
View file @
148e4a81
...
...
@@ -22,13 +22,6 @@ IGNORED_PROPERTIES=%w{chassis chunks thread}
G5K_PROPERTIES
=
%w{api_timestamp available_upto besteffort chunks cluster cluster_priority comment core cpu cpuarch cpucore cpufreq cpuset cputype deploy desktop_computing disk disk_reservation_count diskpath disktype drain eth_count eth_rate expiry_date finaud_decision gpu gpu_count grub host ib ib_count ib_rate id ip last_available_upto last_job_date links maintenance max_walltime memcore memcpu memnode mic myri myri_count myri_rate network_address next_finaud_decision next_state nodemodel production rconsole scheduler_priority slash_16 slash_17 slash_18 slash_19 slash_20 slash_21 slash_22 state state_num subnet_address subnet_prefix suspended_jobs switch type virtual vlan wattmeter opa opa_count opa_rate}
.
sort
-
IGNORED_PROPERTIES
class
Hash
def
slice
(
*
extract
)
h2
=
self
.
select
{
|
key
,
value
|
extract
.
include?
(
key
)
}
h2
end
end
module
RefRepo::Valid::OarProperties
def
self
.
check
(
options
)
ret
=
true
...
...
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