rubix 0.0.11 → 0.0.12
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.
- data/VERSION +1 -1
- data/lib/rubix/sender.rb +16 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.12
|
data/lib/rubix/sender.rb
CHANGED
@@ -109,8 +109,22 @@ module Rubix
|
|
109
109
|
# @return [Rubix::Host]
|
110
110
|
def initialize_host
|
111
111
|
self.host = (Host.find(:name => settings['host']) || Host.new(:name => settings['host']))
|
112
|
-
|
113
|
-
|
112
|
+
|
113
|
+
current_host_group_names = (host.host_groups || []).map(&:name)
|
114
|
+
current_template_names = (host.templates || []).map(&:name)
|
115
|
+
|
116
|
+
host_groups_to_add, templates_to_add = [], []
|
117
|
+
|
118
|
+
(self.host_groups || []).each do |hg|
|
119
|
+
host_groups_to_add << hg unless current_host_group_names.include?(hg.name)
|
120
|
+
end
|
121
|
+
|
122
|
+
(self.templates || []).each do |t|
|
123
|
+
templates_to_add << t unless current_template_names.include?(t.name)
|
124
|
+
end
|
125
|
+
|
126
|
+
host.host_groups = ((host.host_groups || []) + host_groups_to_add).flatten.compact.uniq
|
127
|
+
host.templates = ((host.templates || []) + templates_to_add).flatten.compact.uniq
|
114
128
|
host.save
|
115
129
|
host
|
116
130
|
end
|
metadata
CHANGED