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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88cacd67cd1dd9b6289e5b896b920d3467e3a220
4
- data.tar.gz: a7cf2dccf0ae9133abd81866296784fb6791b0e0
3
+ metadata.gz: eec95c87d792aa11ef19070212ddb9c9a049b958
4
+ data.tar.gz: 6773d4503a617ffe984e536f789d8057f99794db
5
5
  SHA512:
6
- metadata.gz: 368859ec015b8605af21238d7c6d93aa4472c728948d61dcf07095a7728509f4fcdafb2d5867aef0b941a09572ce7ad43ec4ce54a91cde8e6de26fc48a888b9c
7
- data.tar.gz: d1ce8dbd24f8f1a24163e4e5c69d9514d98372885bf14b6f3efd59b824c842d5ed2efee50df7551eec577e0dd15cfc7da36f66f732b6fd35ab74ca7f30f8d9cc
6
+ metadata.gz: 9795fbdcaf8a5d765186a73b9fd7a6e015faea9738340a0e86b31bf199ef865d38b8e95fea9c3398da0ff6ba69ff11cef5480fa28a48639ed41074f9aea75c7e
7
+ data.tar.gz: 719dc3e9eb808fb6cd13b4b43124b9d83bcc15569b061c92f64b1905c639b37d0f86a2b56fa6f074671a3aaec647c995089d5bca26bce433ce93c5bd78dfeddb
@@ -53,7 +53,7 @@ module MCollective
53
53
  require "mcollective/util"
54
54
  require "mcollective/validator"
55
55
 
56
- VERSION = "2.23.1".freeze
56
+ VERSION = "2.23.2".freeze
57
57
 
58
58
  def self.version
59
59
  VERSION
@@ -156,19 +156,23 @@ module MCollective
156
156
  File.join(Dir::COMMON_APPDATA, "ChoriaIO", "choria")
157
157
  end
158
158
 
159
- def self.mcollective_config_paths_for_user
159
+ def self.config_paths_for_user
160
160
  config_paths = []
161
161
 
162
- begin
163
- # File.expand_path will raise if HOME isn't set, catch it
164
- user_path = File.expand_path("~/.mcollective")
165
- config_paths << user_path
166
- rescue Exception # rubocop:disable Lint/RescueException, Lint/SuppressedException
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
- # - APPData/PuppetLabs/mcollective/etc/client.cfg on windows
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 = choria_config_paths_for_user + mcollective_config_paths_for_user
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: choria-mcorpc-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.23.1
4
+ version: 2.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - R.I.Pienaar