opsviewconfig 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/opsviewconfig.rb +7 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0d4eb9251ddbfa588eba622d1bcec7d4603fe90
4
- data.tar.gz: 678c0e76e5d42ea28f6d2423bc68cbc09ee2da0a
3
+ metadata.gz: 1e91608cf94b439c211a03ed30366530fb4838ff
4
+ data.tar.gz: 36490a2345ec07839731b4843be96c67ab4d7c76
5
5
  SHA512:
6
- metadata.gz: 209620095bbab61050459d225b9c890b763215932bb063e91861ed2aeb620f73c97d0552550accc409a1178b5d758aa2360faac6fe6548c63f14e330b2ed2c4d
7
- data.tar.gz: e359dfcd4901c0a4904af334524593a362cd39cb1ff4a8fc8eb45ebd4d0076c34de098c866d73920b73f87fca38075b51f480827262b861dbbe61be9feff6e83
6
+ metadata.gz: 955a2fe2398455be4ebf0e444c87e2bd5c65c12ca12629d445daafb6927403b70a75405270c3d3ad45f51c86983101d21f13c54d81c8f381f1e8fece75ef33c0
7
+ data.tar.gz: 71b156a605d4aed686761ee63974b86145c1073a762f75c539994046bd5f91d54d9d7f56bd83fafd544a09bb489e7446c5aed2ad7f7cabe6d0141ed6f72fe1a4
data/lib/opsviewconfig.rb CHANGED
@@ -29,6 +29,7 @@ class Opsviewconfig
29
29
  # Need to parse out junk we don't need to export
30
30
  res = export_parse(res,resourcetype)
31
31
  res.each do |resource|
32
+ p resource['name']
32
33
  filename = resource['name'].dup
33
34
  filename.gsub!(/[^0-9A-Za-z.\-]/, '_')
34
35
  #puts "Exporting #{resource['name']} to #{filename}"
@@ -59,6 +60,12 @@ class Opsviewconfig
59
60
  if resourcetype == "host" && !resource["hosttemplates"].nil?
60
61
  next if resource["hosttemplates"].find { |h| h['name'] == 'ec2instance'}
61
62
  end
63
+
64
+ # Don't save this if this is one of the default timeperiods
65
+ if resourcetype == "timeperiod"
66
+ next if ["workhours","nonworkhours","none","24x7"].include? resource["name"]
67
+ end
68
+
62
69
  # Save
63
70
  cleanexport << resource.sort_by_key(true)
64
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsviewconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy M
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2015-12-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple class to import and export OpsView config
14
14
  email: dmitriy.mar@gmail.com