lib/junoser/ruler.rb in junoser-0.4.6 vs lib/junoser/ruler.rb in junoser-0.4.7

- old
+ new

@@ -178,10 +178,13 @@ str.gsub! '"dhcp-service" (', '("dhcp-service" | "dhcp") (' # Fix .xsd: "icmpv6" is also acceptable str.gsub! '"icmp6" |', '"icmp6" | "icmpv6" |' + # Fix .xsd: "end-range" of "member-range" + str.gsub! '"end-range"', '"to"' + # # Fix .xsd: "arg" is missing # str.gsub!(/"route-filter" (\(\s*control_route_filter_type\s*\))/) { %["route-filter" arg #{$1}.as(:oneline)] } str.gsub!(/"source-address-filter" (\(\s*control_source_address_filter_type\s*\))/) { %["source-adress-filter" arg #{$1}.as(:oneline)] } @@ -195,17 +198,16 @@ end # Fix .xsd: "ieee-802.3ad" is invalid str.gsub! '"ieee-802.3ad"', '"802.3ad"' - # Fix .xsd: "class-of-service interfaces all unit * classifiers exp foo" - str.gsub!(/^(\s*)sc\(\s*\("default"\)\s*\)/) do - format(['c(', - ' ("default" | arg)', - ')'], $1) - end + # Fix .xsd: "classifiers" + str.gsub! '("default")', '("default" | arg)' + # Fix .xsd: "class-of-service interfaces xxx unit x" + str.gsub! '"*"', 'arg' + # Fix .xsd: "from-zone" arg is also required str.gsub!(/^(\s*)"policy" \(\s*s\(\s*arg,\s*"to-zone-name" arg,\s*c\(\s*"policy" \(\s*policy_type\s*\)\s*\)/) do format(['b(s("from-zone", arg, "to-zone", arg),', ' b("policy", policy_type', ], $1) @@ -228,9 +230,13 @@ # Fix .xsd: "prefix-limit teardown" str.gsub!(/^(\s*)"teardown" (\(.*?as\(:oneline\)\s*\)\s*\))/m) do "#{$1}\"teardown\" arg #{$2},\n#{$1}\"teardown\"" end + + # Fix .xsd: faster interface speed support + str.gsub! '"40g" | "oc3"', '"40g" | "100g" | "200g" | "400g" | "800g" | "oc3"' + str.gsub! '"100G"', '"100G" | "200G" | "400G" | "800G"' str end def format(str, offset = OFFSET)