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
102a7984
Commit
102a7984
authored
Apr 22, 2016
by
Jérémie Gaidamour
Browse files
[dev] Handling API error upfront
parent
681a70a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
dev/run-g5kchecks/run-g5kchecks.rb
View file @
102a7984
...
...
@@ -20,7 +20,14 @@ $g5k = Cute::G5K::API.new()
# puts '...done'
# puts 'Get site_uids'
sites
=
$g5k
.
site_uids
()
begin
sites
=
$g5k
.
site_uids
()
rescue
Exception
=>
e
puts
"Error while getting the site list with ruby-cute:
#{
e
.
class
}
:
#{
e
.
message
}
"
puts
"API unavailable ?"
refapi
=
load_yaml_file_hierarchy
(
"../input/grid5000/"
)
sites
=
refapi
[
"sites"
].
keys
end
# puts '...done'
#
...
...
@@ -192,6 +199,7 @@ if options[:force]
begin
nodes_status
=
$g5k
.
nodes_status
(
site_uid
)
rescue
Exception
=>
e
nodes_status
=
{}
# do not retry
puts
"Error while getting nodes status at
#{
site_uid
}
"
#{e}
next
end
...
...
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