oxidized 0.14.1 → 0.14.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: 244c0ce925a3ae1014ca7d50047cd6167af7de3e
4
- data.tar.gz: 39e6ef1b5e064e56e0f465da938f9de3c5701312
3
+ metadata.gz: 61ca595b5255672ffc615530ca8913fd9e370181
4
+ data.tar.gz: 3c3a7756a3854b1b38882297d44e2d516a5b562b
5
5
  SHA512:
6
- metadata.gz: bc4a2fb8be9e14c4defa550bf777fba102548c4ff4dc28c77bcc41cd19e5298c996716de2046c5d4b28f6418dc2f4f9285a2ca8534299de67de928940c9dd82b
7
- data.tar.gz: ba4694c9ed5791b19a29305e7a49adc420c942093238285334cf590db5944bd277f79db362be75e3278dfea4e379dede383bc7a5c816261a74672f010673c4cc
6
+ metadata.gz: 20b6bac43a2aa14815322182e6a85d960b2a78c1c7b77dac850a9a392fe981acecf93a41336b8ed90262bdeba4001ac62027c8a28a10f0106cd787de5a86360b
7
+ data.tar.gz: 63f76ee63596e77e28a9d76991105df5272e73438099793a347f3ca7679362a8189f32fb7a84747a403007685b3fd0c29cb661f846dcf7ab3dd7bb67b45cc45e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.14.2
2
+ - BUGFIX: git expand path for all groups
3
+ - BUGFIX: git get_version, teletubbies do it again
4
+ - BUGFIX: comware, acos, procurve models
5
+
1
6
  # 0.14.1
2
7
  - BUGFIX: git get_version when groups and single_repo are used
3
8
 
data/README.md CHANGED
@@ -292,6 +292,30 @@ vars:
292
292
  enable: S3cre7
293
293
  ```
294
294
 
295
+ ### Removing secrets
296
+
297
+ To strip out secrets from configurations before storing them, Oxidized needs the the remove_secrets flag. You can globally enable this by adding the following snippet to the global sections of the configuration file.
298
+
299
+ ```
300
+ vars:
301
+ remove_secret: true
302
+ ```
303
+
304
+ Device models can contain substitution filters to remove potentially sensitive data from configs.
305
+
306
+ As a partial example from ios.rb:
307
+
308
+ ```
309
+ cmd :secret do |cfg|
310
+ cfg.gsub! /^(snmp-server community).*/, '\\1 <configuration removed>'
311
+ (...)
312
+ cfg
313
+ end
314
+ ```
315
+ The above strips out snmp community strings from your saved configs.
316
+
317
+ **NOTE:** Removing secrets reduces the usefulness as a full configuration backup, but it may make sharing configs easier.
318
+
295
319
  ### Source: CSV
296
320
 
297
321
  One line per device, colon seperated.
@@ -13,6 +13,8 @@ class Comware < Oxidized::Model
13
13
 
14
14
  cmd :all do |cfg|
15
15
  #cfg.gsub! /^.*\e\[42D/, '' # example how to handle pager
16
+ #skip rogue ^M
17
+ cfg = cfg.gsub /\r/, ''
16
18
  cfg.each_line.to_a[1..-2].join
17
19
  end
18
20
 
@@ -2,7 +2,7 @@ class Procurve < Oxidized::Model
2
2
 
3
3
  # some models start lines with \r
4
4
  # previous command is repeated followed by "\eE", which sometimes ends up on last line
5
- prompt /^\r?([\w -]+\eE)?([\w-]+# )$/
5
+ prompt /^\r?([\w -]+\eE)?([\w.-]+# )$/
6
6
 
7
7
  comment '! '
8
8
 
@@ -21,7 +21,14 @@ class Git < Output
21
21
  Oxidized.asetus.save :user
22
22
  raise NoConfig, 'no output git config, edit ~/.config/oxidized/config'
23
23
  end
24
- @cfg.repo = File.expand_path @cfg.repo
24
+
25
+ if @cfg.repo.respond_to?(:each)
26
+ @cfg.repo.each do |group, repo|
27
+ @cfg.repo["#{group}="] = File.expand_path repo
28
+ end
29
+ else
30
+ @cfg.repo = File.expand_path @cfg.repo
31
+ end
25
32
  end
26
33
 
27
34
  def store file, outputs, opt={}
@@ -105,7 +112,7 @@ class Git < Output
105
112
  repo = @cfg.repo
106
113
  if group && group != '' && !@cfg.single_repo?
107
114
  repo = File.join File.dirname(repo), group + '.git'
108
- elsif group
115
+ elsif group && group != ''
109
116
  node = File.join group, node
110
117
  end
111
118
  repo = Rugged::Repository.new repo
@@ -152,13 +159,19 @@ class Git < Output
152
159
 
153
160
  def update repo, file, data
154
161
  return if data.empty?
162
+
155
163
  if @opt[:group]
156
164
  if @cfg.single_repo?
157
165
  file = File.join @opt[:group], file
158
166
  else
159
- repo = File.join File.dirname(repo), @opt[:group] + '.git'
167
+ repo = if repo.is_a?(String)
168
+ File.join File.dirname(repo), @opt[:group] + '.git'
169
+ else
170
+ repo[@opt[:group]]
171
+ end
160
172
  end
161
173
  end
174
+
162
175
  begin
163
176
  repo = Rugged::Repository.new repo
164
177
  update_repo repo, file, data, @msg, @user, @email
@@ -1,3 +1,3 @@
1
1
  module Oxidized
2
- VERSION = '0.14.1'
2
+ VERSION = '0.14.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-05-06 00:00:00.000000000 Z
13
+ date: 2016-05-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: asetus