Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / puppetlabs-rabbitmq / 0005-Remove-the-rabbitmq_nodename-fact.patch
1 From 02c56be5340b079797fdb9944e1e048f1c3a18b7 Mon Sep 17 00:00:00 2001
2 From: Al Bailey <Al.Bailey@windriver.com>
3 Date: Fri, 2 Feb 2018 12:30:22 -0600
4 Subject: [PATCH] Remove the rabbitmq_nodename fact
5
6 This fact will not work on a standby node.  it requires a drbd folder in order
7 for rabbitmqctl status to work.
8 ---
9  lib/facter/rabbitmq_nodename.rb     |  8 ------
10  spec/unit/rabbitmq_nodename_spec.rb | 50 -------------------------------------
11  2 files changed, 58 deletions(-)
12  delete mode 100644 lib/facter/rabbitmq_nodename.rb
13  delete mode 100644 spec/unit/rabbitmq_nodename_spec.rb
14
15 diff --git a/lib/facter/rabbitmq_nodename.rb b/lib/facter/rabbitmq_nodename.rb
16 deleted file mode 100644
17 index 2ee7926..0000000
18 --- a/lib/facter/rabbitmq_nodename.rb
19 +++ /dev/null
20 @@ -1,8 +0,0 @@
21 -Facter.add(:rabbitmq_nodename) do
22 -  setcode do
23 -    if Facter::Core::Execution.which('rabbitmqctl')
24 -      rabbitmq_nodename = Facter::Core::Execution.execute('rabbitmqctl status 2>&1')
25 -      %r{^Status of node '?([\w\.]+@[\w\.\-]+)'?( \.+)?$}.match(rabbitmq_nodename)[1]
26 -    end
27 -  end
28 -end
29 diff --git a/spec/unit/rabbitmq_nodename_spec.rb b/spec/unit/rabbitmq_nodename_spec.rb
30 deleted file mode 100644
31 index 621d7eb..0000000
32 --- a/spec/unit/rabbitmq_nodename_spec.rb
33 +++ /dev/null
34 @@ -1,50 +0,0 @@
35 -require "spec_helper"
36 -
37 -describe Facter::Util::Fact do
38 -  before {
39 -    Facter.clear
40 -  }
41 -
42 -  describe "rabbitmq_nodename" do
43 -    context 'with value' do
44 -      before :each do
45 -        Facter::Core::Execution.stubs(:which).with('rabbitmqctl').returns(true)
46 -        Facter::Core::Execution.stubs(:execute).with('rabbitmqctl status 2>&1').returns('Status of node monty@rabbit1 ...')
47 -      end
48 -      it {
49 -        expect(Facter.fact(:rabbitmq_nodename).value).to eq('monty@rabbit1')
50 -      }
51 -    end
52 -
53 -    context 'with dashes in hostname' do
54 -      before :each do
55 -        Facter::Core::Execution.stubs(:which).with('rabbitmqctl').returns(true)
56 -        Facter::Core::Execution.stubs(:execute).with('rabbitmqctl status 2>&1').returns('Status of node monty@rabbit-1 ...')
57 -      end
58 -      it {
59 -        expect(Facter.fact(:rabbitmq_nodename).value).to eq('monty@rabbit-1')
60 -      }
61 -    end
62 -
63 -    context 'with quotes around node name' do
64 -      before :each do
65 -        Facter::Core::Execution.stubs(:which).with('rabbitmqctl').returns(true)
66 -        Facter::Core::Execution.stubs(:execute).with('rabbitmqctl status 2>&1').returns('Status of node \'monty@rabbit-1\' ...')
67 -      end
68 -      it {
69 -        expect(Facter.fact(:rabbitmq_nodename).value).to eq('monty@rabbit-1')
70 -      }
71 -    end
72 -
73 -    context 'without trailing points' do
74 -      before :each do
75 -        Facter::Core::Execution.stubs(:which).with('rabbitmqctl').returns(true)
76 -        Facter::Core::Execution.stubs(:execute).with('rabbitmqctl status 2>&1').returns('Status of node monty@rabbit-1')
77 -      end
78 -      it {
79 -        expect(Facter.fact(:rabbitmq_nodename).value).to eq('monty@rabbit-1')
80 -      }
81 -    end
82 -
83 -  end
84 -end
85 -- 
86 1.8.3.1
87