Commit f8e353b6 authored by Samir Noir's avatar Samir Noir 🧀
Browse files

Fix missing user credentials in vlan API

parent adf0c5d6
...@@ -22,6 +22,7 @@ module Vlans ...@@ -22,6 +22,7 @@ module Vlans
@kavlan = Grid5000::Kavlan.new @kavlan = Grid5000::Kavlan.new
@kavlan.tls_options = tls_options_for(:out) @kavlan.tls_options = tls_options_for(:out)
@kavlan.base_uri = api_path @kavlan.base_uri = api_path
@kavlan.user = @credentials[:cn]
end end
def vlan_exist def vlan_exist
......
...@@ -131,7 +131,7 @@ module Grid5000 ...@@ -131,7 +131,7 @@ module Grid5000
def call_kavlan(uri, method) def call_kavlan(uri, method)
begin begin
headers = { 'Accept' => Mime::Type.lookup_by_extension(:json).to_s, 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) http_request(method, uri, tls_options, 10, headers)
rescue StandardError rescue StandardError
raise "Unable to contact #{uri}" raise "Unable to contact #{uri}"
...@@ -142,7 +142,7 @@ module Grid5000 ...@@ -142,7 +142,7 @@ module Grid5000
begin begin
headers = { 'Accept' => Mime::Type.lookup_by_extension(:json).to_s, headers = { 'Accept' => Mime::Type.lookup_by_extension(:json).to_s,
'Content-Type' => 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) http_request(method, uri, tls_options, 10, headers, data.to_json)
rescue StandardError rescue StandardError
raise "Unable to contact #{uri}" raise "Unable to contact #{uri}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment