From 00de2cb906d3bbd5d235d34a5c52c0ca8e9f5541 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Thu, 13 Jul 2017 22:06:36 -0400 Subject: [PATCH] Adds fact for uuid of OVS This is needed for doing host config for Neutron and OpenDaylight. Partial-Bug: 1704206 Change-Id: I7c10aa0351a26c10bef39b311c137209fb4ffb7e Signed-off-by: Tim Rozet --- lib/facter/ovs_uuid.rb | 9 +++++++++ lib/puppet/type/vs_config.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 lib/facter/ovs_uuid.rb diff --git a/lib/facter/ovs_uuid.rb b/lib/facter/ovs_uuid.rb new file mode 100644 index 00000000..cb3aa686 --- /dev/null +++ b/lib/facter/ovs_uuid.rb @@ -0,0 +1,9 @@ +Facter.add("ovs_uuid") do + confine :kernel => "Linux" + + setcode do + if File.exist? '/usr/bin/ovs-vsctl' + ovs_ver = Facter::Core::Execution.exec('/usr/bin/ovs-vsctl get Open_vSwitch . _uuid') + end + end +end diff --git a/lib/puppet/type/vs_config.rb b/lib/puppet/type/vs_config.rb index 68ef2bbb..8c605b33 100644 --- a/lib/puppet/type/vs_config.rb +++ b/lib/puppet/type/vs_config.rb @@ -32,7 +32,7 @@ Puppet::Type.newtype(:vs_config) do end newproperty(:value) do - desc 'Configuration value for the paramter' + desc 'Configuration value for the parameter' validate do |value| if !value.is_a?(String)