Revision e59cda53 snf-cyclades-app/synnefo/db/pools/__init__.py

b/snf-cyclades-app/synnefo/db/pools/__init__.py
287 287
    def index_to_value(self, index):
288 288
        return str(self.net[index + int(self.offset)])
289 289

  
290
    def contains(self, address):
291
        addr = ipaddr.IPAddress(address)
292
        return addr in self.net and super(IPPool, self).contains(address)
290
    def contains(self, address, index=False):
291
        if index is False:
292
            addr = ipaddr.IPAddress(address)
293
            if addr not in self.net:
294
                return False
295
        return super(IPPool, self).contains(address, index=False)
293 296

  
294 297
    def return_start(self):
295 298
        return str(ipaddr.IPAddress(self.base) + self.offset)

Also available in: Unified diff