infochimps-labs / ironfan

Chef orchestration layer -- your system diagram come to life. Provision EC2, OpenStack or Vagrant without changes to cookbooks or configuration
http://infochimps.com
Other
501 stars 102 forks source link

facet.instances = 0 causes spurious error #184

Open temujin9 opened 11 years ago

temujin9 commented 11 years ago
Ironfan.cluster 'broken' do
  facet 'test' do
    instances 0
  end
end

Causes 'ERROR: RuntimeError: No clouds defined, cannot select a cloud

mrflip commented 11 years ago

This comes out of the resolve madness somehow. The resolve stuff isn't passing :owner along, and is dropping other attributes on the floor. This is because the interface for collection() I implemented is totally fucked.

Somehow it leads to there being an orphaned server, which leads to the selected_cloud being picked up as nil for everyone. dunno wtf.

also noting:

[1, 2, 3][0 .. -1]
=> [1, 2, 3]
[1, 2, 3][1 .. 0]
=> []

Maybe there's something simpler going on then I found, but unless someone is really bothered by this the error might be WAY deeper than it looks; I'd wait until new collection interface comes into place.

temujin9 commented 11 years ago

Unfucking that interface has become top priority in my mind, then. The resolution code has been a goat-rope for this entire refactor, and I lack the bandwidth to fix it (and the gorillib confusion that caused it) correctly. It seems to be the source of many small but painful bugs, and I'm really tired of looking at the obvious broken every time they come up. Pretty-please, with sprinkles on top: fix collection().

Ideally, the vivication should be happening once, during resolution. You shouldn't be altering the DSL any after it has resolved; it should be a static representation that everything else uses for reference only. If I knew how (and had time) to cheaply enforce that in code, I would have.