From 22c154500b74c77bf8acbeb6d20c5e30e096e595 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Wed, 24 Oct 2018 23:27:01 +0100 Subject: [PATCH] scenario xml parsing quirks --- secgen.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/secgen.rb b/secgen.rb index a7f1055e0..e5ed13707 100644 --- a/secgen.rb +++ b/secgen.rb @@ -302,7 +302,10 @@ end def get_vm_names(scenario) vm_names = [] parser = Nori.new - scenario_hash = parser.parse(File.read(scenario))['scenario'] + scenario_hash = parser.parse(File.read(scenario)) + if scenario_hash.key?('scenario') + scenario_hash = scenario_hash['scenario'] + end if scenario_hash['system'].is_a? Array scenario_hash['system'].each do |system| vm_names << system['system_name']