integ/config/puppet-modules/puppet-network/centos/files/Don-t-write-absent-to-redhat-route-files-and-test-fo.patch
Scott Little bab9bb6b69 Internal restructuring of stx-integ
Create new directories:
   ceph
   config
   config-files
   filesystem
   kernel
   kernel/kernel-modules
   ldap
   logging
   strorage-drivers
   tools
   utilities
   virt

Retire directories:
   connectivity
   core
   devtools
   support
   extended

Delete two packages:
   tgt
   irqbalance

Relocated packages:
   base/
      dhcp
      initscripts
      libevent
      lighttpd
      linuxptp
      memcached
      net-snmp
      novnc
      ntp
      openssh
      pam
      procps
      sanlock
      shadow
      sudo
      systemd
      util-linux
      vim
      watchdog

   ceph/
      python-cephclient

   config/
      facter
      puppet-4.8.2
      puppet-modules

   filesystem/
      e2fsprogs
      nfs-utils
      nfscheck

   kernel/
      kernel-std
      kernel-rt

   kernel/kernel-modules/
      mlnx-ofa_kernel

   ldap/
      nss-pam-ldapd
      openldap

   logging/
      syslog-ng
      logrotate

   networking/
      lldpd
      iproute
      mellanox
      python-ryu
      mlx4-config

   python/
      python-2.7.5
      python-django
      python-gunicorn
      python-setuptools
      python-smartpm
      python-voluptuous

   security/
      shim-signed
      shim-unsigned
      tboot

   strorage-drivers/
      python-3parclient
      python-lefthandclient

   virt/
      cloud-init
      libvirt
      libvirt-python
      qemu

   tools/
      storage-topology
      vm-topology

   utilities/
      tis-extensions
      namespace-utils
      nova-utils
      update-motd

Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 10:06:31 -04:00

72 lines
3.2 KiB
Diff

From 49e103bbeb4d6efe1ca75f581d41ee6a8ed7caf5 Mon Sep 17 00:00:00 2001
From: Romanos Skiadas <rom.skiad@gmail.com>
Date: Wed, 2 Nov 2016 14:51:47 -0400
Subject: [PATCH] Don't write absent to redhat route files and test for this
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
---
.../network/lib/puppet/provider/network_route/redhat.rb | 9 +++++++--
.../spec/unit/provider/network_route/redhat_spec.rb | 17 ++++++++++++++++-
2 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/packstack/puppet/modules/network/lib/puppet/provider/network_route/redhat.rb b/packstack/puppet/modules/network/lib/puppet/provider/network_route/redhat.rb
index f45eab5..9841c8e 100644
--- a/packstack/puppet/modules/network/lib/puppet/provider/network_route/redhat.rb
+++ b/packstack/puppet/modules/network/lib/puppet/provider/network_route/redhat.rb
@@ -84,10 +84,15 @@ Puppet::Type.type(:network_route).provide(:redhat) do
raise Puppet::Error, "#{provider.name} does not have a #{prop}." if provider.send(prop).nil?
end
if provider.network == "default"
- contents << "#{provider.network} via #{provider.gateway} dev #{provider.interface} #{provider.options}\n"
+ contents << "#{provider.network} via #{provider.gateway} dev #{provider.interface}\n"
else
- contents << "#{provider.network}/#{provider.netmask} via #{provider.gateway} dev #{provider.interface} #{provider.options}\n"
+ contents << "#{provider.network}/#{provider.netmask} via #{provider.gateway} dev #{provider.interface}\n"
end
+ contents << if provider.options == :absent
+ "\n"
+ else
+ " #{provider.options}\n"
+ end
end
contents.join
end
diff --git a/packstack/puppet/modules/network/spec/unit/provider/network_route/redhat_spec.rb b/packstack/puppet/modules/network/spec/unit/provider/network_route/redhat_spec.rb
index dfc9d6b..1ad2128 100644
--- a/packstack/puppet/modules/network/spec/unit/provider/network_route/redhat_spec.rb
+++ b/packstack/puppet/modules/network/spec/unit/provider/network_route/redhat_spec.rb
@@ -91,7 +91,18 @@ describe Puppet::Type.type(:network_route).provider(:redhat) do
)
end
- let(:content) { described_class.format_file('', [route1_provider, route2_provider, defaultroute_provider]) }
+ let(:nooptions_provider) do
+ stub('nooptions_provider',
+ name: 'default',
+ network: 'default',
+ netmask: '',
+ gateway: '10.0.0.1',
+ interface: 'eth2',
+ options: :absent
+ )
+ end
+
+ let(:content) { described_class.format_file('', [route1_provider, route2_provider, defaultroute_provider, nooptions_provider]) }
describe "writing the route line" do
describe "For standard (non-default) routes" do
@@ -122,6 +133,10 @@ describe Puppet::Type.type(:network_route).provider(:redhat) do
it "should have the correct fields appended" do
content.scan(/^default .*$/).first.should be_include("default via 10.0.0.1 dev eth1")
end
+
+ it 'should not contain the word absent when no options are defined' do
+ expect(content).to_not match(/absent/)
+ end
end
end
end
--
1.8.3.1