ironfan 4.12.1 → 4.12.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v4.12.2
2
+ * REALM discovery aids cleanup: see https://github.com/infochimps-labs/ironfan/pull/310 for details
3
+
1
4
  # v4.12.1
2
5
  * REALM discovery aids: see https://github.com/infochimps-labs/ironfan/pull/309 for details
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.12.1
1
+ 4.12.2
data/ironfan.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ironfan"
8
- s.version = "4.12.1"
8
+ s.version = "4.12.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Infochimps"]
12
- s.date = "2013-09-26"
12
+ s.date = "2013-09-29"
13
13
  s.description = "Ironfan allows you to orchestrate not just systems but clusters of machines. It includes a powerful layer on top of knife and a collection of cloud cookbooks."
14
14
  s.email = "coders@infochimps.com"
15
15
  s.extra_rdoc_files = [
@@ -7,10 +7,8 @@ module Ironfan
7
7
  def initialize(attrs={},&block)
8
8
  super
9
9
  self.cluster_role Ironfan::Dsl::Role.new(:name => "#{attrs[:name]}-cluster")
10
- end
11
-
12
- def facet(name,attrs={},&block)
13
- super(name,attrs.merge(cluster_names: cluster_names),&block)
10
+ self.realm_name attrs[:owner].name unless attrs[:owner].nil?
11
+ self.cluster_names attrs[:owner].cluster_names unless attrs[:owner].nil?
14
12
  end
15
13
 
16
14
  # Utility method to reference all servers from constituent facets
@@ -20,8 +18,9 @@ module Ironfan
20
18
  result
21
19
  end
22
20
 
23
- def cluster_name() name; end
21
+ def cluster_name
22
+ name
23
+ end
24
24
  end
25
-
26
25
  end
27
26
  end
@@ -28,6 +28,7 @@ module Ironfan
28
28
  member :facet_role, Ironfan::Dsl::Role
29
29
 
30
30
  magic :cluster_names, Whatever
31
+ magic :realm_name, Symbol
31
32
 
32
33
  def initialize(attrs={},&block)
33
34
  self.underlay = attrs[:owner] if attrs[:owner]
@@ -7,7 +7,9 @@ module Ironfan
7
7
  field :cluster_name, String
8
8
 
9
9
  def initialize(attrs={},&block)
10
- self.cluster_name = attrs[:owner].name unless attrs[:owner].nil?
10
+ self.cluster_names attrs[:owner].cluster_names unless attrs[:owner].nil?
11
+ self.realm_name attrs[:owner].realm_name unless attrs[:owner].nil?
12
+ self.cluster_name = attrs[:owner].cluster_name unless attrs[:owner].nil?
11
13
  self.name = attrs[:name] unless attrs[:name].nil?
12
14
  self.facet_role Ironfan::Dsl::Role.new(:name => "#{full_name}-facet")
13
15
  super
@@ -15,8 +17,6 @@ module Ironfan
15
17
  end
16
18
 
17
19
  def full_name() "#{cluster_name}-#{name}"; end
18
-
19
20
  end
20
-
21
21
  end
22
- end
22
+ end
@@ -7,26 +7,28 @@ module Ironfan
7
7
  magic :cluster_suffixes, Whatever
8
8
 
9
9
  def initialize(attrs={},&block)
10
- cluster_names OpenStruct.new
11
- cluster_suffixes OpenStruct.new
10
+ cluster_names({})
11
+ realm_name attrs[:name] if attrs[:name]
12
12
  super
13
13
  end
14
14
 
15
15
  def cluster(label, attrs={},&blk)
16
16
  new_name = [realm_name, label].join('_').to_sym
17
- cluster = Ironfan::Dsl::Cluster.new(name: new_name, cluster_names: OpenStruct.new)
18
- cluster_names.new_ostruct_member label
19
- cluster_names.send "#{label}=", new_name
20
- cluster_suffixes.new_ostruct_member label
21
- cluster_suffixes.send "#{label}=", label
22
- (clusters.keys.map{|k| clusters[k]} << cluster).each do |cl|
23
- cl.cluster_names cluster_names
24
- end
17
+ cluster = Ironfan::Dsl::Cluster.new(name: new_name, owner: self, cluster_names: cluster_names)
18
+ cluster_names[label] = new_name
25
19
  cluster.receive!(attrs, &blk)
26
20
  super(new_name, cluster)
27
21
  end
28
22
 
29
- def realm_name() name; end
23
+ def cluster_name suffix
24
+ clusters.fetch([realm_name, suffix.to_s].join('_').to_sym).name.to_sym
25
+ end
26
+
27
+ def cluster_suffix suffix
28
+ clusters.
29
+ fetch([realm_name, suffix.to_s].join('_').to_sym).name.to_s.
30
+ gsub(/^#{realm_name}_/, '').to_sym
31
+ end
30
32
  end
31
33
  end
32
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ironfan
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.1
4
+ version: 4.12.2
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: 2013-09-26 00:00:00.000000000 Z
12
+ date: 2013-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -382,7 +382,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
382
382
  version: '0'
383
383
  segments:
384
384
  - 0
385
- hash: 3895515305460381618
385
+ hash: 4472391313830122724
386
386
  required_rubygems_version: !ruby/object:Gem::Requirement
387
387
  none: false
388
388
  requirements: