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
f8e353b6
Commit
f8e353b6
authored
Nov 12, 2020
by
Samir Noir
🧀
Browse files
Fix missing user credentials in vlan API
parent
adf0c5d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controllers/concerns/vlans.rb
View file @
f8e353b6
...
...
@@ -22,6 +22,7 @@ module Vlans
@kavlan
=
Grid5000
::
Kavlan
.
new
@kavlan
.
tls_options
=
tls_options_for
(
:out
)
@kavlan
.
base_uri
=
api_path
@kavlan
.
user
=
@credentials
[
:cn
]
end
def
vlan_exist
...
...
lib/grid5000/kavlan.rb
View file @
f8e353b6
...
...
@@ -131,7 +131,7 @@ module Grid5000
def
call_kavlan
(
uri
,
method
)
begin
headers
=
{
'Accept'
=>
Mime
::
Type
.
lookup_by_extension
(
:json
).
to_s
,
'X-
Remote-Ident
'
=>
user
}
'X-
Api-User-Cn
'
=>
user
}
http_request
(
method
,
uri
,
tls_options
,
10
,
headers
)
rescue
StandardError
raise
"Unable to contact
#{
uri
}
"
...
...
@@ -142,7 +142,7 @@ module Grid5000
begin
headers
=
{
'Accept'
=>
Mime
::
Type
.
lookup_by_extension
(
:json
).
to_s
,
'Content-Type'
=>
Mime
::
Type
.
lookup_by_extension
(
:json
).
to_s
,
'X-
Remote-Ident
'
=>
user
}
'X-
Api-User-Cn
'
=>
user
}
http_request
(
method
,
uri
,
tls_options
,
10
,
headers
,
data
.
to_json
)
rescue
StandardError
raise
"Unable to contact
#{
uri
}
"
...
...
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