nifty 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34535f6d35b3c8a655fd2e09ba345bed53776e33
4
- data.tar.gz: 3da0882d184d3100c510ad0586c0b38c8adb9b7d
3
+ metadata.gz: 20ccc2cf0a1d6ba0b26e0a5bcdb893436e244bd3
4
+ data.tar.gz: b4926f2fb82bc8d69f571186162a650ae0904744
5
5
  SHA512:
6
- metadata.gz: fdaeac11c89d829767d745b7e33f5290cf02bd9a243fd24a637303d8c8bf79270d94a8a8b5f64236bfa444ca0463c6396eca4ca6c6356bcbc54afc890578c532
7
- data.tar.gz: a6d550cf0e9c89b9bfebe07c971892bdee2af05c3479485c33fa0d4597df41839ebdb84d01c10bb9f0ea0b31e8af6eba4f4583d798f1e9be222f964536b065f7
6
+ metadata.gz: 45c91c2a17ec5d818194b7e6a794cc4722a8d189d734eee98ab8cc8860b671b556014432512435477a20ce6006ca0346e0789a73e54e73893b25fb8db0bacbb0
7
+ data.tar.gz: 3bdb417b706e1526938423cbc6d2ca40200b9d2da27270e4d84a3519156cc45c653bd7ef4a6e7e1ef6397828ee06499eff98ba39353376a7c674dcb857fd829f
data/README.md CHANGED
@@ -96,6 +96,7 @@ Options:
96
96
  [--description-naming], [--no-description-naming] # If true, uses identifier and version from appliance description as template/image name instead of generated uuids
97
97
  [--disk-expiration], [--no-disk-expiration] # Will expire old disks before the new one is registered
98
98
  --permissions=PERMISSIONS # UNIX-like image and template permissions in OpenNebula
99
+ [--groups=one two three] # Names of groups appliances will be registred to in OpenNebula
99
100
  -a, --appliance-dir=APPLIANCE-DIR # Directory from where appliance descriptors will be loaded
100
101
  -m, --transfer-method=TRANSFER-METHOD # Transfer method for image upload
101
102
  -t, [--transfer-destination=TRANSFER-DESTINATION] # Image upload destination
data/config/nifty.yml CHANGED
@@ -12,6 +12,7 @@ production:
12
12
  description-naming: false # If true, uses identifier and version from appliance description as template/image name instead of generated uuids
13
13
  disk-expiration: true # Will expire old disks before the new one is registered
14
14
  permissions: "640" # UNIX-like image and template permissions in OpenNebula, MUST be a string
15
+ groups: # Array of groups. If set, groups in appliance descriptor will be ignored and these groups will be used instead
15
16
  logging:
16
17
  level: ERROR # Logging level
17
18
  file: /var/log/nifty/nifty.log # File to write log to. To turn off file logging leave this field empty.
@@ -53,6 +53,10 @@ class Nifty::Backends::Opennebula < Nifty::Backend
53
53
  :required => true,
54
54
  :type => :string,
55
55
  :desc => 'UNIX-like image and template permissions in OpenNebula'
56
+ },
57
+ :groups => {
58
+ :type => :array,
59
+ :desc => 'Names of groups appliances will be registred to in OpenNebula'
56
60
  }
57
61
  }
58
62
  end
@@ -34,7 +34,7 @@ class Nifty::Events::Opennebula::RegistrationEvent < Nifty::Events::Opennebula::
34
34
 
35
35
  expire_appliance(template_handler, image_handler, appliance, parameters)
36
36
 
37
- groups = groups(group_handler, appliance)
37
+ groups = groups(group_handler, appliance, parameters[:groups])
38
38
  # due to OpenNebula restrictions appliances have to be registered separately for each datastore and each group
39
39
  datastores.each do |datastore|
40
40
  groups.each do |group|
@@ -16,10 +16,12 @@ module Nifty::Events::Opennebula::Utils::EventsCommon
16
16
  #
17
17
  # @param [Nifty::Backends::Utils::Opennebula::GroupHandler] group_handler
18
18
  # @param [Cloud::Appliance::Descriptor::Appliance] appliance
19
+ # @param [Array] prior_groups groups from configuration file that if exist will be used instead of the groups in appliance
19
20
  # @return [Array] Array of groups
20
- def groups(group_handler, appliance)
21
+ def groups(group_handler, appliance, prior_groups)
21
22
  groups = []
22
- appliance.groups.each do |group_name|
23
+ group_names = prior_groups || appliance.groups
24
+ group_names.each do |group_name|
23
25
  group = group_handler.group(group_name)
24
26
  fail Nifty::Errors::Backends::Opennebula::ResourceNotFoundError, "No such group with name #{group_name.inspect}" unless group
25
27
 
data/lib/nifty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nifty
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nifty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Kimle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-11 00:00:00.000000000 Z
11
+ date: 2016-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler