Skip to content

Instantly share code, notes, and snippets.

@dallasmarlow
Created November 22, 2013 21:46
Show Gist options
  • Save dallasmarlow/7607427 to your computer and use it in GitHub Desktop.
Save dallasmarlow/7607427 to your computer and use it in GitHub Desktop.
row4 nodes needing intake
layer3_racks = ["C401", "C402"]
row4_assets = collins.find rack_position: 'EWR01-C4',
type: :server_node,
size: 10000
filters = [
Proc.new {|asset, _| asset.nics.any? {|nic| nic['SPEED'] == 10000000000}},
Proc.new {|asset, layer3_racks| layer3_racks.any? {|rack| asset.rack_position.include?(rack)}}
]
row4_assets.reject {|asset| filters.any? {|filter| filter.call asset, layer3_racks}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment