mirror of
https://github.com/xcat2/confluent.git
synced 2026-09-29 08:41:00 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a8132d87a7 | |||
| 65d6ff13fa |
@@ -205,6 +205,7 @@ def uuid_is_valid(uuid):
|
||||
return uuid.lower() not in ('00000000-0000-0000-0000-000000000000',
|
||||
'ffffffff-ffff-ffff-ffff-ffffffffffff',
|
||||
'00112233-4455-6677-8899-aabbccddeeff',
|
||||
'03000200-0400-0500-0006-000700080009',
|
||||
'20202020-2020-2020-2020-202020202020')
|
||||
|
||||
def _printable_ip(sa):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2017 Lenovo
|
||||
# Copyright 2017-2021 Lenovo
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -664,9 +664,13 @@ def reply_dhcp4(node, info, packet, cfg, reqview, httpboot, cfd, profile):
|
||||
clipn = socket.inet_aton(niccfg['ipv4_address'])
|
||||
repview[16:20] = clipn
|
||||
gateway = niccfg['ipv4_gateway']
|
||||
netmask = niccfg['prefix']
|
||||
if gateway:
|
||||
gateway = socket.inet_aton(gateway)
|
||||
netmask = niccfg['prefix']
|
||||
if not netutil.ipn_on_same_subnet(socket.AF_INET, clipn, gateway, netmask):
|
||||
log.log(
|
||||
{'warning': 'Ignoring gateway {0} due to mismatch with address {1}/{2}'.format(niccfg['ipv4_gateway'], niccfg['ipv4_address'], netmask)})
|
||||
gateway = None
|
||||
netmask = (2**32 - 1) ^ (2**(32 - netmask) - 1)
|
||||
netmask = struct.pack('!I', netmask)
|
||||
myipn = niccfg['deploy_server']
|
||||
|
||||
Reference in New Issue
Block a user