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
@kavlan = Grid5000::Kavlan.new
@kavlan.tls_options = tls_options_for(:out)
@kavlan.base_uri = api_path
@kavlan.user = @credentials[:cn]
end
def vlan_exist
......
......@@ -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}"
......
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