choria-mcorpc-support 2.23.1 → 2.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mcollective.rb +1 -1
- data/lib/mcollective/util.rb +23 -31
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eec95c87d792aa11ef19070212ddb9c9a049b958
|
4
|
+
data.tar.gz: 6773d4503a617ffe984e536f789d8057f99794db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9795fbdcaf8a5d765186a73b9fd7a6e015faea9738340a0e86b31bf199ef865d38b8e95fea9c3398da0ff6ba69ff11cef5480fa28a48639ed41074f9aea75c7e
|
7
|
+
data.tar.gz: 719dc3e9eb808fb6cd13b4b43124b9d83bcc15569b061c92f64b1905c639b37d0f86a2b56fa6f074671a3aaec647c995089d5bca26bce433ce93c5bd78dfeddb
|
data/lib/mcollective.rb
CHANGED
data/lib/mcollective/util.rb
CHANGED
@@ -156,19 +156,23 @@ module MCollective
|
|
156
156
|
File.join(Dir::COMMON_APPDATA, "ChoriaIO", "choria")
|
157
157
|
end
|
158
158
|
|
159
|
-
def self.
|
159
|
+
def self.config_paths_for_user
|
160
160
|
config_paths = []
|
161
161
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
162
|
+
["~/.choriarc", "~/.mcollective"].each do |f|
|
163
|
+
begin
|
164
|
+
# File.expand_path will raise if HOME isn't set, catch it
|
165
|
+
config_paths << File.expand_path(f)
|
166
|
+
rescue ArgumentError # rubocop:disable Lint/SuppressedException
|
167
|
+
end
|
167
168
|
end
|
168
169
|
|
169
170
|
if windows?
|
171
|
+
config_paths << File.join(choria_windows_prefix, "etc", "client.conf")
|
170
172
|
config_paths << File.join(windows_prefix, "etc", "client.cfg")
|
171
173
|
else
|
174
|
+
config_paths << "/etc/choria/client.conf"
|
175
|
+
config_paths << "/usr/local/etc/choria/client.conf"
|
172
176
|
config_paths << "/etc/puppetlabs/mcollective/client.cfg"
|
173
177
|
config_paths << "/etc/mcollective/client.cfg"
|
174
178
|
config_paths << "/usr/local/etc/mcollective/client.cfg"
|
@@ -177,42 +181,30 @@ module MCollective
|
|
177
181
|
config_paths
|
178
182
|
end
|
179
183
|
|
180
|
-
def self.choria_config_paths_for_user
|
181
|
-
config_paths = []
|
182
|
-
|
183
|
-
begin
|
184
|
-
# File.expand_path will raise if HOME isn't set, catch it
|
185
|
-
user_path = File.expand_path("~/.choriarc")
|
186
|
-
config_paths << user_path
|
187
|
-
rescue Exception # rubocop:disable Lint/RescueException, Lint/SuppressedException
|
188
|
-
end
|
189
|
-
|
190
|
-
if windows?
|
191
|
-
config_paths << File.join(choria_windows_prefix, "etc", "client.conf")
|
192
|
-
else
|
193
|
-
config_paths << "/etc/choria/client.conf"
|
194
|
-
config_paths << "/usr/local/etc/choria/client.conf"
|
195
|
-
end
|
196
|
-
|
197
|
-
config_paths
|
198
|
-
end
|
199
|
-
|
200
184
|
# Picks the default user config file, priorities are first Choria ones then old MCollective ones
|
201
185
|
#
|
202
186
|
# In roughly this order, first to exist is used:
|
203
187
|
#
|
204
188
|
# - ~/.choriarc
|
205
|
-
# - APPData/ChoriaIO/choria/etc/client.conf on windows
|
206
|
-
# - /etc/choria/client.conf then
|
207
|
-
# - /usr/local/etc/choria/client.conf on unix
|
208
189
|
# - ~/.mcollective
|
209
|
-
#
|
190
|
+
#
|
191
|
+
# On Unix:
|
192
|
+
#
|
193
|
+
# - /etc/choria/client.conf
|
194
|
+
# - /usr/local/etc/choria/client.conf
|
210
195
|
# - /etc/puppetlabs/mcollective/client.cfg
|
211
196
|
# - /etc/mcollective/client.cfg
|
212
197
|
# - /usr/local/etc/mcollective/client.cfg
|
198
|
+
#
|
199
|
+
# On Windows:
|
200
|
+
#
|
201
|
+
# - APPData/ChoriaIO/choria/etc/client.conf on windows
|
202
|
+
# - APPData/PuppetLabs/mcollective/etc/client.cfg on windows
|
213
203
|
def self.config_file_for_user
|
214
|
-
config_paths =
|
204
|
+
config_paths = config_paths_for_user
|
205
|
+
|
215
206
|
found = config_paths.find_index { |file| File.readable?(file) } || 0
|
207
|
+
|
216
208
|
config_paths[found]
|
217
209
|
end
|
218
210
|
|