tcell_agent 0.2.15 → 0.2.16

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: a19cf745ceeba3dd9fc30a26a6ea22103f9c9ab7
4
- data.tar.gz: de4954a7726b10aeb96f7babe0fbbb5404642738
3
+ metadata.gz: f85f2f3d36743fb454fedfe89d0405f25ba46fa4
4
+ data.tar.gz: 328a8ab46597707c4305b40b707d48a004f84ac5
5
5
  SHA512:
6
- metadata.gz: 131299425420cdc2e7222cd3c536238bbc78f6dd04d63b6aac58531975107afc2d9b4a1d42e9941f5f8505f2df6c2ba6779bc1ba1acb5bca4971f0fd057016a4
7
- data.tar.gz: d146b41e0de91462ddfa1418a0840a15f49acabdabf21b13c7e296264cccc2f28674eeb906c7ed036930c55aa0601feec5bd333b6ba741dab70ac242b24104a8
6
+ metadata.gz: 0a7f284d81621c91f7f142ea8c1bbc3941b64de7d9c203d5d2b07def0b351c766b8fbf750e763e9d9013c02ec2a0ac9e47c722bdc19db584aa2fa0920b69a5dc
7
+ data.tar.gz: 7637ca1c15dbeadc23ef5d72922d2f0e675653d0349c5ccc31dd3d2a394ec93298568047ca7a75eaeda61aca05dae252187be33e29a783e28b0b05b425ae305a
@@ -188,6 +188,7 @@ module TCellAgent
188
188
 
189
189
  @disable_all = app_data.fetch("disable_all", @disable_all)
190
190
  @enabled = app_data.fetch("enabled", @enabled)
191
+
191
192
  @enable_event_manager = app_data.fetch("enable_event_manager", @enable_event_manager)
192
193
  @enable_event_consumer = app_data.fetch("enable_event_consumer", @enable_event_consumer)
193
194
  @enable_policy_polling = app_data.fetch("enable_policy_polling", @enable_policy_polling)
@@ -5,6 +5,14 @@ require 'tcell_agent/configuration'
5
5
 
6
6
  module TCellAgent
7
7
 
8
+ class NullLoger < Logger
9
+ def initialize(*args)
10
+ end
11
+
12
+ def add(*args, &block)
13
+ end
14
+ end
15
+
8
16
  class TCellLogDevice < Logger::LogDevice
9
17
  def create_logfile(filename)
10
18
  logdev = super
@@ -16,6 +24,7 @@ module TCellAgent
16
24
  end
17
25
 
18
26
  @@logger_pid = Process.pid
27
+ @null_logger = TCellAgent::NullLoger.new
19
28
 
20
29
  def self.loggingLevelFromString(levelString)
21
30
  if (levelString == "DEBUG")
@@ -34,6 +43,9 @@ module TCellAgent
34
43
  end
35
44
 
36
45
  def self.appfirewall_payloads_logger
46
+ if TCellAgent.configuration.enabled == false
47
+ return @null_logger
48
+ end
37
49
  if defined?(@paylods_logger) && @logger_pid == Process.pid
38
50
  return @payloads_logger
39
51
  end
@@ -64,6 +76,9 @@ module TCellAgent
64
76
  end
65
77
 
66
78
  def self.logger
79
+ if TCellAgent.configuration.enabled == false
80
+ return @null_logger
81
+ end
67
82
  if defined?(@logger) && @logger_pid == Process.pid
68
83
  return @logger
69
84
  end
@@ -1,14 +1,27 @@
1
+ require 'pathname'
2
+
1
3
  module TCellAgent
2
4
  module Utils
3
5
  module IO
4
6
 
5
7
  def self.create_directory(dir, owner=nil)
6
8
  unless File.directory?(dir)
7
- FileUtils.mkdir_p(dir)
9
+ directories = Pathname(dir).each_filename.to_a
10
+
11
+ return if directories.size < 1
12
+
13
+ memoized_path = File::SEPARATOR
14
+
15
+ directories.each do |directory|
16
+ memoized_path = File.join(memoized_path, directory)
17
+ unless File.directory?(memoized_path)
18
+ FileUtils.mkdir(memoized_path)
8
19
 
9
- if TCellAgent::Utils::Strings.present?(owner)
10
- TCellAgent::Instrumentation.safe_block("Ignoring agent_home_owner value, insufficient privileges") do
11
- FileUtils.chown( owner, nil, dir )
20
+ if TCellAgent::Utils::Strings.present?(owner)
21
+ TCellAgent::Instrumentation.safe_block("Ignoring agent_home_owner value, insufficient privileges") do
22
+ FileUtils.chown( owner, nil, memoized_path)
23
+ end
24
+ end
12
25
  end
13
26
  end
14
27
  end
@@ -1,5 +1,5 @@
1
1
  # See the file "LICENSE" for the full license governing this code.
2
2
 
3
3
  module TCellAgent
4
- VERSION = "0.2.15"
4
+ VERSION = "0.2.16"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcell_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garrett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-13 00:00:00.000000000 Z
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client