Merge pull request #41 from jamtur01/master

Fix for puppetlabs-openstack GH Issue #17
This commit is contained in:
James Turnbull 2011-07-26 16:27:16 -07:00
commit 82a4378155
2 changed files with 11 additions and 2 deletions

View File

@ -7,11 +7,15 @@ Puppet::Type.type(:nova_network).provide(:nova_manage) do
commands :nova_manage => 'nova-manage'
def exists?
nova_manage("network", "list").match(/^#{resource[:network]}\/[0-9]{1,2} /)
begin
nova_manage("network", "list").match(/^#{resource[:network]}\/[0-9]{1,2} /)
rescue
return false
end
end
def create
nova_manage("network", "create", resource[:network], "1", resource[:available_ips])
nova_manage("network", "create", resource[:label], resource[:network], "1", resource[:available_ips])
end
def destroy

View File

@ -13,6 +13,11 @@ Puppet::Type.newtype(:nova_network) do
newvalues(/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.0$/)
end
newparam(:label) do
desc "The Nova network label"
defaultto "novanetwork"
end
newparam(:available_ips) do
desc "# of available IPs. Must be greater than 4."
validate do |value|