Remove duplicate loading of constants

This commit moves another constant so that it iscontained inside a do
  block instead of at the top of the file for the ovs provider.

  Without this change the constants in question will generate a warning
  because of the way puppet loads providers.  Anything in ruby defined
  outside some other context gets parsed/executed immediately instead of
  when needed.

Change-Id: I70d7aecce28d041638adedb58b6fe7bc5302d235
This commit is contained in:
Cody Herriges 2016-02-16 13:27:44 -08:00
parent 231e5ca7d7
commit f4785cc8f3

View File

@ -1,10 +1,11 @@
require 'puppet' require 'puppet'
UUID_RE = /[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}/
Puppet::Type.type(:vs_port).provide(:ovs) do Puppet::Type.type(:vs_port).provide(:ovs) do
desc 'Openvswitch port manipulation' desc 'Openvswitch port manipulation'
UUID_RE ||= /[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}/
has_feature :bonding has_feature :bonding
has_feature :vlan has_feature :vlan