puppet-nova/lib/puppet/provider/nova_network/nova_manage.rb
Dan Bode 072e519171 Converted into nova module repo.
- removed all submodules
  I will create an openstack repo to
  hold all modules (including nova) as
  submodules
- moved nova module to top dir
2011-06-16 20:29:58 -07:00

23 lines
457 B
Ruby

Puppet::Type.type(:nova_network).provide(:nova_manage) do
desc "Manage nova network"
defaultfor :kernel => 'Linux'
commands :nova_manage => 'nova-manage'
def exists?
nova_manage("network", "list").match(/^#{resource[:network]}\/[0-9]{1,2} /)
end
def create
nova_manage("network", "create", resource[:network], "1", resource[:available_ips])
end
def destroy
nova_manage("network", "delete", resource[:network])
end
end