def upgrade_1_4(): ip_pool_collection = get_collection('servers_ip_pool') docs = ip_pool_collection.find({}, { '_id': True, 'network': True, }) for doc in docs: if isinstance(doc['network'], (int, long)): continue ip_pool_collection.update({ '_id': doc['_id'], }, {'$set': { 'network': utils.fnv32a(doc['network']) }})
def network_hash(self): return utils.fnv32a((self.network or '') + '-' + (self.network_start or '') + '-' + (self.network_end or ''))
def network_hash(self): return utils.fnv32a( (self.network or '') + '-' + (self.network_start or '') + '-' + (self.network_end or '') )
def network_hash(self): return utils.fnv32a((self.network or "") + "-" + (self.network_start or "") + "-" + (self.network_end or ""))