berta 1.1.0 → 1.1.1

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: b4e81e829b874c07ff7ab8ae0226238d5baa52b4
4
- data.tar.gz: 99b0e83b23f5213db848f45403b8c901071a6c8b
3
+ metadata.gz: 91063490154b9f650a1fb3e09f1f7b26a813750a
4
+ data.tar.gz: 03c2636a66ee408f3c1242c7513d0095d72320c5
5
5
  SHA512:
6
- metadata.gz: 13a6e7deea100c608d490391b4f3f3377f1771139399f7917c074c4d2faea12e5c905923568b68855c3bbe6718338e1d5c50b9d8a3db8adb2cd68c0e7b644062
7
- data.tar.gz: df347f0d85a29be79b8c5152e5c13c9ed9de2a3201a3add8c7ebde8f34aad4888705fa146b40d62ba17d38e2b949851e1b12116940459a8372848bc4aaef079d
6
+ metadata.gz: 974a9efb0a0e3fee64b9e4339012a223ab12b5c991de92b7568c9e23bc6b3e7138b1eafda9fbbd24a17060cd196d427b2c98055b473a0bd25aec81f3e1354512
7
+ data.tar.gz: 8fecd681443d6b73202be53b00ad1dcb428dde17c6298579b87a6dccad1e113f854cd6fdd152a41b84543ee55762059f4b437de5bbbc4da4b454e21260e9095d
data/berta.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'berta'
3
- s.version = '1.1.0'
3
+ s.version = '1.1.1'
4
4
  s.summary = 'Berta VM expiration tool'
5
5
  s.description = 'Berta will check all VMs on OpenNebula cloud for expiration date'
6
6
  s.authors = ['Dusan Baran']
@@ -0,0 +1,11 @@
1
+ # Cron job running by default every six hours.
2
+ # The lock file can be enabled or disabled via:
3
+ #
4
+ # service berta-cron start
5
+ # chkconfig berta-cron on
6
+ #
7
+ # Note that the lock file not existing is a success (and
8
+ # over-all success is needed in order to prevent error
9
+ # messages from cron).
10
+
11
+ 30 */6 * * * berta [ ! -f /var/lock/berta-cron ] || /usr/bin/berta
@@ -0,0 +1,63 @@
1
+ #!/bin/sh
2
+
3
+ ### BEGIN INIT INFO
4
+ # Provides: berta-cron
5
+ # Required-Start: $remote_fs $syslog
6
+ # Required-Stop: $remote_fs $syslog
7
+ # Default-Start: 2 3 4 5
8
+ # Default-Stop: 0 1 6
9
+ # Short-Description: Enable periodic run of berta
10
+ # Description: This shell script enables the automatic use of berta
11
+ ### END INIT INFO
12
+
13
+ lockfile="/var/lock/berta-cron"
14
+ retval=0
15
+ name=`basename $0`
16
+
17
+ start() {
18
+ touch $lockfile
19
+ echo "Enabling periodic $name"
20
+ retval=0
21
+ }
22
+
23
+ stop() {
24
+ rm -f $lockfile
25
+ echo "Disabling periodic $name"
26
+ retval=0
27
+ }
28
+
29
+ restart() {
30
+ stop
31
+ start
32
+ }
33
+
34
+ case "$1" in
35
+ start)
36
+ start
37
+ ;;
38
+ stop)
39
+ stop
40
+ ;;
41
+ restart|force-reload)
42
+ restart
43
+ ;;
44
+ reload)
45
+ ;;
46
+ condrestart)
47
+ [ -f "$lockfile" ] && restart
48
+ ;;
49
+ status)
50
+ if [ -f "$lockfile" ] ; then
51
+ echo "Periodic $name is enabled"
52
+ retval=0
53
+ else
54
+ echo "Periodic $name is disabled"
55
+ retval=3
56
+ fi
57
+ ;;
58
+ *)
59
+ echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
60
+ retval=1
61
+ esac
62
+
63
+ exit $retval
@@ -18,8 +18,8 @@ module Berta
18
18
  @service = service
19
19
  email_file = 'email.erb'.freeze
20
20
  email_template_path = "#{File.dirname(__FILE__)}/../../config/#{email_file}"
21
- email_template_path = "etc/berta/#{email_file}" \
22
- if File.exist?("etc/berta/#{email_file}")
21
+ email_template_path = "/etc/berta/#{email_file}" \
22
+ if File.exist?("/etc/berta/#{email_file}")
23
23
  email_template_path = "#{ENV['HOME']}/.berta/#{email_file}" \
24
24
  if File.exist?("#{ENV['HOME']}/.berta/#{email_file}")
25
25
  @email_template = Tilt.new(email_template_path)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dusan Baran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-27 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -251,6 +251,8 @@ files:
251
251
  - bin/berta
252
252
  - config/berta.yml
253
253
  - config/email.erb
254
+ - examples/etc/cron.d/berta
255
+ - examples/etc/init.d/berta-cron
254
256
  - lib/berta.rb
255
257
  - lib/berta/cli.rb
256
258
  - lib/berta/command_executor.rb
@@ -297,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
299
  version: '0'
298
300
  requirements: []
299
301
  rubyforge_project:
300
- rubygems_version: 2.6.10
302
+ rubygems_version: 2.6.8
301
303
  signing_key:
302
304
  specification_version: 4
303
305
  summary: Berta VM expiration tool