From aa3544e3790af931279ea6727dbfb49d2fb43fad Mon Sep 17 00:00:00 2001 From: Lukas Zapletal Date: Wed, 27 Jul 2016 17:07:08 +0200 Subject: [PATCH] Fixes #15864 - Pxelinux alias variant for Syslinux --- modules/tftp/server.rb | 1 + modules/tftp/tftp_api.rb | 2 +- test/tftp/tftp_api_test.rb | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/tftp/server.rb b/modules/tftp/server.rb index 737c6c908..9bf4e194a 100644 --- a/modules/tftp/server.rb +++ b/modules/tftp/server.rb @@ -74,6 +74,7 @@ def pxeconfig_file mac ["#{pxeconfig_dir}/01-"+mac.gsub(/:/,"-").downcase] end end + class Pxelinux < Syslinux; end class Pxegrub < Server def pxeconfig_dir diff --git a/modules/tftp/tftp_api.rb b/modules/tftp/tftp_api.rb index f083d215b..80b7db64c 100644 --- a/modules/tftp/tftp_api.rb +++ b/modules/tftp/tftp_api.rb @@ -8,7 +8,7 @@ class Api < ::Sinatra::Base helpers ::Proxy::Helpers authorize_with_trusted_hosts authorize_with_ssl_client - VARIANTS = ["Syslinux", "Pxegrub", "Pxegrub2", "Ztp", "Poap"].freeze + VARIANTS = ["Syslinux", "Pxelinux", "Pxegrub", "Pxegrub2", "Ztp", "Poap"].freeze helpers do def instantiate variant, mac=nil diff --git a/test/tftp/tftp_api_test.rb b/test/tftp/tftp_api_test.rb index 1a768b798..2be1a9d71 100644 --- a/test/tftp/tftp_api_test.rb +++ b/test/tftp/tftp_api_test.rb @@ -25,6 +25,11 @@ def test_instantiate_syslinux assert_equal "Proxy::TFTP::Syslinux", obj.class.name end + def test_instantiate_pxelinux + obj = app.helpers.instantiate "pxelinux", "AA:BB:CC:DD:EE:FF" + assert_equal "Proxy::TFTP::Pxelinux", obj.class.name + end + def test_instantiate_pxegrub obj = app.helpers.instantiate "pxegrub", "AA:BB:CC:DD:EE:FF" assert_equal "Proxy::TFTP::Pxegrub", obj.class.name