puppet-nova/lib/puppet/provider/nova_network/nova_manage.rb
Dan Bode d5dc26c7f3 set network bridge in the provider
This commit sets the network bridge manually in the
call to nova-manage.

This change is required for essex support.
2012-03-19 17:59:00 -07:00

28 lines
606 B
Ruby

Puppet::Type.type(:nova_network).provide(:nova_manage) do
desc "Manage nova network"
optional_commands :nova_manage => 'nova-manage'
def exists?
begin
network_list = nova_manage("network", "list")
return network_list.split("\n")[1..-1].detect do |n|
n =~ /^(\S+)\s+(#{resource[:network]})/
end
rescue
return false
end
end
def create
nova_manage("network", "create", resource[:label], resource[:network], "1", resource[:available_ips], "--bridge=br100")
end
def destroy
nova_manage("network", "delete", resource[:network])
end
end