topological_inventory-providers-common 1.0.1 → 1.0.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/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/README.md +5 -0
- data/lib/topological_inventory/providers/common/logging.rb +27 -2
- data/lib/topological_inventory/providers/common/version.rb +1 -1
- data/topological_inventory-providers-common.gemspec +3 -3
- metadata +23 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76ba202072a52538f20a377fcf8f85923ba04e2ad745d64dc59c95c0332e6474
|
4
|
+
data.tar.gz: 74664f658d5299244d9276a964ac9c2a8c15a96840c0d6749dac09b567e3b968
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfd655f70da56219cb312d4c5b46403b71b6401ac9dd47e2ed6827f079a4df7d6edc5e89e33c293438a7c2dcbdbc024382605917b9ec8e5ec3a75d9553cd6eb5
|
7
|
+
data.tar.gz: 642ea847c5f186e62983a7df70bc39feaf7aa8a841d07ef5f0dcaf9a7cdb59866eace13dcbc9730712bbc8b7f2761f51b1df79befc357fc58f02ef16fab192b5
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.0.2] - 2020-05-15
|
8
|
+
### Changed
|
9
|
+
|
10
|
+
Extend logger with common logging phrases #22
|
11
|
+
Security update: JSON 2.3, ActiveSupport 5.2.4.3 #23
|
12
|
+
|
7
13
|
## [1.0.1] - 2020-05-06
|
8
14
|
### Changed
|
9
15
|
|
@@ -15,5 +21,6 @@ manageiq-loggers to >= 0.4.2 #20
|
|
15
21
|
### Initial release to rubygems.org
|
16
22
|
|
17
23
|
[Unreleased]: https://github.com/RedHatInsights/topological_inventory-providers-common/compare/v1.0.1...HEAD
|
24
|
+
[1.0.2]: https://github.com/RedHatInsights/topological_inventory-providers-common/compare/v1.0.1...v1.0.2
|
18
25
|
[1.0.1]: https://github.com/RedHatInsights/topological_inventory-providers-common/compare/v1.0.0...v1.0.1
|
19
26
|
[1.0.0]: https://github.com/RedHatInsights/topological_inventory-providers-common/releases/v1.0.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
1
|
# TopologicalInventory::Providers::Common
|
2
2
|
|
3
|
+
[](https://travis-ci.org/RedHatInsights/topological_inventory-providers-common)
|
4
|
+
[](https://codeclimate.com/github/RedHatInsights/topological_inventory-providers-common/maintainability)
|
5
|
+
[](https://codeclimate.com/github/RedHatInsights/topological_inventory-providers-common/test_coverage)
|
6
|
+
[](https://hakiri.io/github/RedHatInsights/topological_inventory-providers-common/master)
|
7
|
+
|
3
8
|
Common code for topological-inventory collectors and Operation workers.
|
@@ -3,13 +3,38 @@ require "manageiq/loggers"
|
|
3
3
|
module TopologicalInventory
|
4
4
|
module Providers
|
5
5
|
module Common
|
6
|
+
module LoggingFunctions
|
7
|
+
def collecting(status, source, entity_type, refresh_state_uuid, total_parts = nil)
|
8
|
+
msg = "[#{status.to_s.upcase}] Collecting #{entity_type}"
|
9
|
+
msg += ", :total parts => #{total_parts}" if total_parts.present?
|
10
|
+
msg += ", :source_uid => #{source}, :refresh_state_uuid => #{refresh_state_uuid}"
|
11
|
+
info(msg)
|
12
|
+
end
|
13
|
+
|
14
|
+
def collecting_error(source, entity_type, refresh_state_uuid, exception)
|
15
|
+
msg = "[ERROR] Collecting #{entity_type}, :source_uid => #{source}, :refresh_state_uuid => #{refresh_state_uuid}"
|
16
|
+
msg += ":message => #{exception.message}\n#{exception.backtrace.join("\n")}"
|
17
|
+
error(msg)
|
18
|
+
end
|
19
|
+
|
20
|
+
def sweeping(status, source, sweep_scope, refresh_state_uuid)
|
21
|
+
msg = "[#{status.to_s.upcase}] Sweeping inactive records, :sweep_scope => #{sweep_scope}, :source_uid => #{source}, :refresh_state_uuid => #{refresh_state_uuid}"
|
22
|
+
info(msg)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Logger < ManageIQ::Loggers::CloudWatch
|
27
|
+
def self.new(*args)
|
28
|
+
super.tap { |logger| logger.extend(TopologicalInventory::Providers::Common::LoggingFunctions) }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
6
32
|
class << self
|
7
33
|
attr_writer :logger
|
8
34
|
end
|
9
35
|
|
10
36
|
def self.logger
|
11
|
-
@logger ||=
|
12
|
-
@logger
|
37
|
+
@logger ||= TopologicalInventory::Providers::Common::Logger.new
|
13
38
|
end
|
14
39
|
|
15
40
|
module Logging
|
@@ -23,13 +23,13 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
+
spec.add_runtime_dependency 'activesupport', '~> 5.2.4.3'
|
26
27
|
spec.add_runtime_dependency 'config', '~> 1.7', '>= 1.7.2'
|
27
|
-
spec.add_runtime_dependency
|
28
|
+
spec.add_runtime_dependency 'json', '~> 2.3'
|
28
29
|
spec.add_runtime_dependency "manageiq-loggers", ">= 0.4.2"
|
29
|
-
spec.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
30
30
|
spec.add_runtime_dependency "topological_inventory-api-client", "~> 3.0", ">= 3.0.1"
|
31
31
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 2.0"
|
33
|
-
spec.add_development_dependency "rake", "
|
33
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.0"
|
35
35
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: topological_inventory-providers-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Slemr
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.2.4.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.2.4.3
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: config
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,19 +45,19 @@ dependencies:
|
|
31
45
|
- !ruby/object:Gem::Version
|
32
46
|
version: 1.7.2
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
48
|
+
name: json
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
36
50
|
requirements:
|
37
51
|
- - "~>"
|
38
52
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
53
|
+
version: '2.3'
|
40
54
|
type: :runtime
|
41
55
|
prerelease: false
|
42
56
|
version_requirements: !ruby/object:Gem::Requirement
|
43
57
|
requirements:
|
44
58
|
- - "~>"
|
45
59
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
60
|
+
version: '2.3'
|
47
61
|
- !ruby/object:Gem::Dependency
|
48
62
|
name: manageiq-loggers
|
49
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,26 +72,6 @@ dependencies:
|
|
58
72
|
- - ">="
|
59
73
|
- !ruby/object:Gem::Version
|
60
74
|
version: 0.4.2
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: json
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 2.1.0
|
68
|
-
- - "~>"
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '2.1'
|
71
|
-
type: :runtime
|
72
|
-
prerelease: false
|
73
|
-
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - ">="
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 2.1.0
|
78
|
-
- - "~>"
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '2.1'
|
81
75
|
- !ruby/object:Gem::Dependency
|
82
76
|
name: topological_inventory-api-client
|
83
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,16 +110,16 @@ dependencies:
|
|
116
110
|
name: rake
|
117
111
|
requirement: !ruby/object:Gem::Requirement
|
118
112
|
requirements:
|
119
|
-
- - "
|
113
|
+
- - ">="
|
120
114
|
- !ruby/object:Gem::Version
|
121
|
-
version:
|
115
|
+
version: 12.3.3
|
122
116
|
type: :development
|
123
117
|
prerelease: false
|
124
118
|
version_requirements: !ruby/object:Gem::Requirement
|
125
119
|
requirements:
|
126
|
-
- - "
|
120
|
+
- - ">="
|
127
121
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
122
|
+
version: 12.3.3
|
129
123
|
- !ruby/object:Gem::Dependency
|
130
124
|
name: rspec
|
131
125
|
requirement: !ruby/object:Gem::Requirement
|