From 265498fcf59bd2e787bb01361999771b4ec4e833 Mon Sep 17 00:00:00 2001
From: Martin Magr <mmagr@redhat.com>
Date: Wed, 19 Feb 2014 14:25:51 +0100
Subject: [PATCH] Don't be too strict for vlan_ranges
VLAN range can be also in format of physical network or with only
single ID. This patch makes those values pass the validation
For more info please check https://bugzilla.redhat.com/show_bug.cgi?id=1066549
Change-Id: I054fbd45ac2228a3a579c08cdd617d970abcaddf
(cherry picked from commit 8fd57075d13e7c4e84e66378e2490eb02f3a00c1)
---
lib/puppet/parser/functions/validate_network_vlan_ranges.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/puppet/parser/functions/validate_network_vlan_ranges.rb b/lib/puppet/parser/functions/validate_network_vlan_ranges.rb
index 013ee08..f363ef5 100644
--- a/lib/puppet/parser/functions/validate_network_vlan_ranges.rb
+++ b/lib/puppet/parser/functions/validate_network_vlan_ranges.rb
@@ -36,6 +36,9 @@ module Puppet::Parser::Functions
if ((second_id - first_id) < 0 )
raise Puppet::Error, "network vlan ranges are invalid."
end
+ elsif m = /^([^:]+)?(:\d+)?$/.match(range)
+ # Either only name of physical network or single vlan id has
+ # been passed. This is also correct.
elsif range
raise Puppet::Error, "network vlan ranges are invalid."
end
--
1.8.5.3