Package: puppet-module-puppetlabs-rabbitmq / 5.3.1-5

fix-LANG-problem-in-provider.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Description: Fix $LANG problem in provider
 If $LANG isn't set, rabbitmqctl produces a bad warning which prevents
 setting-up rabbit credentials. This only happen with recent versions of
 rabbitmq and elixir.
 .
 To work around this, the lib/puppet/provider scripts set the $LANG
 environment variable to en_US.UTF-8. Also, in
 lib/puppet/provider/rabbitmq_user_permissions/rabbitmqctl.rb, as it looked
 like not enough, the script is grep-ing the warning out.
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2018-10-29

--- puppet-module-puppetlabs-rabbitmq-5.3.1.orig/lib/puppet/provider/rabbitmq_binding/rabbitmqadmin.rb
+++ puppet-module-puppetlabs-rabbitmq-5.3.1/lib/puppet/provider/rabbitmq_binding/rabbitmqadmin.rb
@@ -4,13 +4,14 @@ Puppet::Type.type(:rabbitmq_binding).pro
 
   if Puppet::PUPPETVERSION.to_f < 3
     commands :rabbitmqctl   => 'rabbitmqctl'
+       environment :LANG => "en_US.UTF-8"
     commands :rabbitmqadmin => '/usr/local/bin/rabbitmqadmin'
   else
     has_command(:rabbitmqctl, 'rabbitmqctl') do
-      environment :HOME => "/tmp"
+      environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
     end
     has_command(:rabbitmqadmin, '/usr/local/bin/rabbitmqadmin') do
-      environment :HOME => "/tmp"
+      environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
     end
   end
   defaultfor :feature => :posix
--- puppet-module-puppetlabs-rabbitmq-5.3.1.orig/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb
+++ puppet-module-puppetlabs-rabbitmq-5.3.1/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb
@@ -4,13 +4,14 @@ Puppet::Type.type(:rabbitmq_exchange).pr
 
   if Puppet::PUPPETVERSION.to_f < 3
     commands :rabbitmqctl   => 'rabbitmqctl'
+       environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
     commands :rabbitmqadmin => '/usr/local/bin/rabbitmqadmin'
   else
     has_command(:rabbitmqctl, 'rabbitmqctl') do
-      environment :HOME => "/tmp"
+      environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
     end
     has_command(:rabbitmqadmin, '/usr/local/bin/rabbitmqadmin') do
-      environment :HOME => "/tmp"
+      environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
     end
   end
   defaultfor :feature => :posix
--- puppet-module-puppetlabs-rabbitmq-5.3.1.orig/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb
+++ puppet-module-puppetlabs-rabbitmq-5.3.1/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb
@@ -4,17 +4,19 @@ Puppet::Type.type(:rabbitmq_plugin).prov
   if Puppet::PUPPETVERSION.to_f < 3
     if Facter.value(:osfamily) == 'RedHat'
       commands :rabbitmqplugins => '/usr/lib/rabbitmq/bin/rabbitmq-plugins'
+         environment :LANG => "en_US.UTF-8"
     else
       commands :rabbitmqplugins => 'rabbitmq-plugins'
+         environment :LANG => "en_US.UTF-8"
     end
   else
     if Facter.value(:osfamily) == 'RedHat'
       has_command(:rabbitmqplugins, '/usr/lib/rabbitmq/bin/rabbitmq-plugins') do
-        environment :HOME => "/tmp"
+        environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
       end
     else
       has_command(:rabbitmqplugins, 'rabbitmq-plugins') do
-        environment :HOME => "/tmp"
+        environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
       end
     end
   end
--- puppet-module-puppetlabs-rabbitmq-5.3.1.orig/lib/puppet/provider/rabbitmq_queue/rabbitmqadmin.rb
+++ puppet-module-puppetlabs-rabbitmq-5.3.1/lib/puppet/provider/rabbitmq_queue/rabbitmqadmin.rb
@@ -4,13 +4,15 @@ Puppet::Type.type(:rabbitmq_queue).provi
 
   if Puppet::PUPPETVERSION.to_f < 3
     commands :rabbitmqctl   => 'rabbitmqctl'
+       environment :LANG => "en_US.UTF-8"
     commands :rabbitmqadmin => '/usr/bin/rabbitmqadmin'
+       environment :LANG => "en_US.UTF-8"
   else
     has_command(:rabbitmqctl, 'rabbitmqctl') do
-      environment :HOME => "/tmp"
+      environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
     end
     has_command(:rabbitmqadmin, '/usr/bin/rabbitmqadmin') do
-      environment :HOME => "/tmp"
+      environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
     end
   end
   defaultfor :feature => :posix
--- puppet-module-puppetlabs-rabbitmq-5.3.1.orig/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
+++ puppet-module-puppetlabs-rabbitmq-5.3.1/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
@@ -5,9 +5,10 @@ Puppet::Type.type(:rabbitmq_user).provid
 
   if Puppet::PUPPETVERSION.to_f < 3
     commands :rabbitmqctl => 'rabbitmqctl'
+       environment :LANG => "en_US.UTF-8", :LC_ALL => "en_US.UTF-8"
   else
      has_command(:rabbitmqctl, 'rabbitmqctl') do
-       environment :HOME => "/tmp"
+       environment :HOME => "/tmp", :LANG => "en_US.UTF-8", :LC_ALL => "en_US.UTF-8"
      end
   end
 
--- puppet-module-puppetlabs-rabbitmq-5.3.1.orig/lib/puppet/provider/rabbitmq_user_permissions/rabbitmqctl.rb
+++ puppet-module-puppetlabs-rabbitmq-5.3.1/lib/puppet/provider/rabbitmq_user_permissions/rabbitmqctl.rb
@@ -3,9 +3,10 @@ Puppet::Type.type(:rabbitmq_user_permiss
 
   if Puppet::PUPPETVERSION.to_f < 3
     commands :rabbitmqctl => 'rabbitmqctl'
+       environment :HOME => "/tmp", :LANG => "en_US.UTF-8", :LC_ALL => "en_US.UTF-8"
   else
      has_command(:rabbitmqctl, 'rabbitmqctl') do
-       environment :HOME => "/tmp"
+       environment :HOME => "/tmp", :LANG => "en_US.UTF-8", :LC_ALL => "en_US.UTF-8"
      end
   end
 
@@ -18,7 +19,7 @@ Puppet::Type.type(:rabbitmq_user_permiss
       @users[name] = {}
       self.run_with_retries {
         rabbitmqctl('-q', 'list_user_permissions', name)
-      }.split(/\n/).each do |line|
+      }.split(/\n/).grep(/^\(\(?!warning: the VM is running with native name encoding of latin1\)\)/).each do |line|
         line = self::strip_backslashes(line)
         if line =~ /^(\S+)\s+(\S*)\s+(\S*)\s+(\S*)$/
           @users[name][$1] =
--- puppet-module-puppetlabs-rabbitmq-5.3.1.orig/lib/puppet/provider/rabbitmq_vhost/rabbitmqctl.rb
+++ puppet-module-puppetlabs-rabbitmq-5.3.1/lib/puppet/provider/rabbitmq_vhost/rabbitmqctl.rb
@@ -3,9 +3,10 @@ Puppet::Type.type(:rabbitmq_vhost).provi
 
   if Puppet::PUPPETVERSION.to_f < 3
     commands :rabbitmqctl => 'rabbitmqctl'
+       environment :LANG => "en_US.UTF-8"
   else
      has_command(:rabbitmqctl, 'rabbitmqctl') do
-       environment :HOME => "/tmp"
+       environment :HOME => "/tmp", :LANG => "en_US.UTF-8"
      end
   end