chef-monitor 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ /bin/test*
1
2
  /pkg
2
3
  /config
3
4
  /orgs
data/chef-monitor.gemspec CHANGED
@@ -21,5 +21,4 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency "bunny", ">= 1.1.0"
22
22
  s.add_dependency "file-tail", ">= 1.0.12"
23
23
  s.add_dependency "daemons", ">= 1.1.9"
24
- s.add_dependency "chef", ">= 10.0.0"
25
24
  end
@@ -96,7 +96,8 @@ class Monitor
96
96
  begin
97
97
  item = rest.get_rest(object)
98
98
  result = JSON.pretty_generate(item)
99
- rescue
99
+ rescue Exception => e
100
+ Monitor::Log.new(e.message + ' with object: ' + @organization + "/" + object , 'ERROR')
100
101
  return nil
101
102
  end
102
103
  return result
@@ -104,7 +105,7 @@ class Monitor
104
105
 
105
106
  def commit(path)
106
107
  current_dir = Dir.pwd
107
- commit_dir = File.join(path, @organization, @object)
108
+ commit_dir = File.join(path, @organization)
108
109
  Dir.chdir(commit_dir)
109
110
  @version ? object = [@organization, @object, @name, @version].join('/') : object = [@organization, @object, @name].join('/')
110
111
  text = "User : " + @user + "\nObject : " + object + "\nAction : " + @action + "\nLog Time : " + @time
@@ -121,7 +122,7 @@ class Monitor
121
122
 
122
123
  def commit_nohook(path)
123
124
  current_dir = Dir.pwd
124
- commit_dir = File.join(path, @organization, @object)
125
+ commit_dir = File.join(path, @organization)
125
126
  Dir.chdir(commit_dir)
126
127
  %x(git config hooks.exclude true)
127
128
  %x(git add .)
@@ -149,6 +150,8 @@ class Monitor
149
150
  download.config[:latest] = true unless @version
150
151
  download.config[:force] = true
151
152
  result = (download.run())
153
+ file = File.join(download_dir, @name + "-" + @version, ".gitignore")
154
+ File.delete(file) if File.exist?(file)
152
155
  self.path = download_dir
153
156
  rescue Exception => e
154
157
  return e
@@ -85,10 +85,11 @@ class Monitor
85
85
  str[1..-1] if str[0] == '/'
86
86
  end
87
87
 
88
- def get_rest_item(target)
88
+ def get_rest_item(object)
89
89
  begin
90
- result = rest.get_rest(target)
91
- rescue
90
+ result = rest.get_rest(object)
91
+ rescue Exception => e
92
+ Monitor::Log.new(e.message + ' with object: ' + @organization + "/" + object , 'ERROR')
92
93
  return []
93
94
  end
94
95
  return result
@@ -16,6 +16,6 @@
16
16
  # limitations under the License.
17
17
 
18
18
  class Monitor
19
- VERSION = "0.1.2"
19
+ VERSION = "0.1.3"
20
20
  MAJOR, MINOR, TINY = VERSION.split('.')
21
21
  end
@@ -41,7 +41,6 @@ class Monitor
41
41
  obj.delete(DOWNLOAD_PATH)
42
42
  else
43
43
  items = Monitor::ItemList.new(data)
44
-
45
44
  items.each do |item|
46
45
  if data['action'] == "PUT"
47
46
  item.download(DOWNLOAD_PATH)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-07 00:00:00.000000000 Z
12
+ date: 2014-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bunny
@@ -59,22 +59,6 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.1.9
62
- - !ruby/object:Gem::Dependency
63
- name: chef
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: 10.0.0
70
- type: :runtime
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: 10.0.0
78
62
  description: Chef Monitoring tool to monitor all changes made
79
63
  email:
80
64
  - sander.botman@gmail.com