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
g5k-api
Commits
a072f478
Commit
a072f478
authored
Jul 16, 2020
by
Samir Noir
🧀
Browse files
Fix the get_kaerror method in deployment model
parent
7bac3d00
Pipeline
#157801
waiting for manual action with stages
in 19 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/models/grid5000/deployment.rb
View file @
a072f478
...
...
@@ -165,7 +165,7 @@ module Grid5000
if
%w{200 201 202 204}
.
include?
(
http
.
code
.
to_s
)
update_attribute
(
:uid
,
JSON
.
parse
(
http
.
body
)[
'wid'
])
else
error
(
get_kaerror
(
http
,
http
.
header
s
))
error
(
get_kaerror
(
http
,
http
.
header
))
# Cannot continue since :uid is not set
raise
self
.
output
+
"
\n
"
end
...
...
@@ -209,7 +209,7 @@ module Grid5000
uri
=
File
.
join
(
base_uri
,
uid
,
'error'
)
http
=
http_request
(
:get
,
uri
,
tls_options
,
15
,
headers
)
rescue
error
(
get_kaerror
(
http
,
http
.
header
s
))
error
(
get_kaerror
(
http
,
http
.
header
))
error
(
"Unable to contact
#{
File
.
join
(
base_uri
,
uid
,
'error'
)
}
"
)
raise
self
.
output
+
"
\n
"
end
...
...
@@ -231,7 +231,7 @@ module Grid5000
if
hdr
[
'X_APPLICATION_ERROR_CODE'
]
and
hdr
[
'X_APPLICATION_ERROR_INFO'
]
"Kadeploy error #
#{
hdr
[
'X_APPLICATION_ERROR_CODE'
]
}
:
#{
Base64
.
strict_decode64
(
hdr
[
'X_APPLICATION_ERROR_INFO'
])
}
"
else
"HTTP error #
#{
hdr
.
statu
s
}
:
#{
resp
}
"
"HTTP error #
#{
resp
.
code
.
to_
s
}
:
#{
resp
.
body
}
"
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