berta 1.1.1 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91063490154b9f650a1fb3e09f1f7b26a813750a
4
- data.tar.gz: 03c2636a66ee408f3c1242c7513d0095d72320c5
3
+ metadata.gz: ececb77853659dd54a17d796131da207313ae58d
4
+ data.tar.gz: a884181a2657eacfc072097d672fbae909abf4ef
5
5
  SHA512:
6
- metadata.gz: 974a9efb0a0e3fee64b9e4339012a223ab12b5c991de92b7568c9e23bc6b3e7138b1eafda9fbbd24a17060cd196d427b2c98055b473a0bd25aec81f3e1354512
7
- data.tar.gz: 8fecd681443d6b73202be53b00ad1dcb428dde17c6298579b87a6dccad1e113f854cd6fdd152a41b84543ee55762059f4b437de5bbbc4da4b454e21260e9095d
6
+ metadata.gz: 2ccddda1fb68d8c57cadec7240257de7f87f01efa89149718920b7aaa2ab4b1803630543d851e933c6eea22dea0705a5cd384e3298146c4e17bc69d81fadb9f0
7
+ data.tar.gz: a19d4303d08b671a4deb6c18475ba39a00887b5191cca89790c89bca1e94ce2241028e41b60e62d6d4d658753c584641d2ce5d90415456dd0dcb6757264a0f8b
data/berta.gemspec CHANGED
@@ -1,6 +1,12 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'berta/version'
6
+
1
7
  Gem::Specification.new do |s|
2
8
  s.name = 'berta'
3
- s.version = '1.1.1'
9
+ s.version = Berta::VERSION
4
10
  s.summary = 'Berta VM expiration tool'
5
11
  s.description = 'Berta will check all VMs on OpenNebula cloud for expiration date'
6
12
  s.authors = ['Dusan Baran']
data/config/berta.yml CHANGED
@@ -13,7 +13,7 @@ berta:
13
13
  groups: # VMs in this groups will be ignored
14
14
  clusters: # VMs in this clusters will be ignored
15
15
  logging:
16
- file: /var/log/berta/berta.log # File ro write log to. To turn off file logging leave this field empty
16
+ file: /var/log/berta/berta.log # File to write log to. To turn off file logging leave this field empty
17
17
  level: error # Logging level
18
- dry-run: false # Berta wont change anything on running instance of OpenNebula
18
+ dry-run: false # Berta won't change anything on running instance of OpenNebula
19
19
  debug: false # Debug mode
data/config/email.erb CHANGED
@@ -1,4 +1,4 @@
1
- <%# Avaliable parametes: %>
1
+ <%# Available parameters: %>
2
2
  <%# [String] user_name %>
3
3
  <%# [String] user_email %>
4
4
  <%# [Array<Hash>] vms, Array of Hashes with values: %>
data/lib/berta.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # Main Berta module
2
2
  module Berta
3
+ autoload :Version, 'berta/version'
3
4
  autoload :Service, 'berta/service'
4
5
  autoload :VirtualMachineHandler, 'berta/virtual_machine_handler'
5
6
  autoload :ExpirationManager, 'berta/expiration_manager'
data/lib/berta/cli.rb CHANGED
@@ -63,6 +63,12 @@ module Berta
63
63
  initialize_logger(options)
64
64
  Berta::CommandExecutor.cleanup
65
65
  end
66
+
67
+ desc 'version', 'Prints berta version'
68
+ def version
69
+ $stdout.puts Berta::VERSION
70
+ end
71
+
66
72
  default_task :cleanup
67
73
 
68
74
  private
@@ -79,10 +79,10 @@ module Berta
79
79
  user_name = user['NAME']
80
80
  raise Berta::Errors::Entities::NoUserEmailError, "User: #{user_name} with id: #{user['ID']} has no email set" \
81
81
  unless user_email
82
- mail = Mail.new(email_template.render(Hash,
83
- user_email: user_email,
84
- user_name: user_name,
85
- vms: vms_data(vms)))
82
+ email_text = email_template.render(Hash, user_email: user_email, user_name: user_name, vms: vms_data(vms))
83
+ logger.debug "Sending mail to user: #{user_name} with email: #{user_email}:\n#{email_text}"
84
+ return if Berta::Settings['dry-run']
85
+ mail = Mail.new(email_text)
86
86
  mail.delivery_method :sendmail
87
87
  mail.deliver
88
88
  end
@@ -0,0 +1,3 @@
1
+ module Berta
2
+ VERSION = '1.1.2'.freeze
3
+ end
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.1
4
+ version: 1.1.2
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-03-06 00:00:00.000000000 Z
11
+ date: 2017-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -278,6 +278,7 @@ files:
278
278
  - lib/berta/utils.rb
279
279
  - lib/berta/utils/opennebula.rb
280
280
  - lib/berta/utils/opennebula/helper.rb
281
+ - lib/berta/version.rb
281
282
  - lib/berta/virtual_machine_handler.rb
282
283
  homepage: https://github.com/dudoslav/berta
283
284
  licenses:
@@ -299,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
300
  version: '0'
300
301
  requirements: []
301
302
  rubyforge_project:
302
- rubygems_version: 2.6.8
303
+ rubygems_version: 2.4.8
303
304
  signing_key:
304
305
  specification_version: 4
305
306
  summary: Berta VM expiration tool