Revision 44bd008a snf-cyclades-app/synnefo/api/management/commands/network-create.py

b/snf-cyclades-app/synnefo/api/management/commands/network-create.py
135 135
            help="IP allocation pools to be used for assigning IPs to"
136 136
                 " VMs. Can be used multiple times. Syntax: \n"
137 137
                 "192.168.42.220,192.168.42.240. Starting IP must proceed "
138
                 "ending IP."),
138
                 "ending IP. If no allocation pools are given, the whole "
139
                 "subnet range is used, excluding the gateway IP, the "
140
                 "broadcast address and the network address"),
139 141
    )
140 142

  
141 143
    @convert_api_faults
......
183 185
                                  floating_ip_pool=floating_ip_pool)
184 186

  
185 187
        if subnet is not None:
186
            alloc = subnets.parse_allocation_pools(allocation_pools)
188
            alloc = None
189
            if allocation_pools is not None:
190
                alloc = subnets.parse_allocation_pools(allocation_pools)
191
                alloc.sort()
187 192
            name = "IPv4 Subnet of Network %s" % network.id
188 193
            subnets.create_subnet(network.id, cidr=subnet, name=name,
189 194
                                  ipversion=4, gateway=gateway, dhcp=dhcp,
190 195
                                  user_id=userid,
191
                                  allocation_pools=sorted(alloc))
196
                                  allocation_pools=alloc)
192 197

  
193 198
        if subnet6 is not None:
194 199
            name = "IPv6 Subnet of Network %s" % network.id

Also available in: Unified diff