Add MAC Address Configuration
This commit is contained in:
+6
-11
@@ -143,14 +143,14 @@ def create_endpoint():
|
||||
if_host, if_container = veth_pair(endpoint_id)
|
||||
logger.info('creating veth pair %s <=> %s', if_host, if_container)
|
||||
if_host = interface.CreateInterface(LIBRARY, if_host, 'veth', if_container)
|
||||
if_host.up()
|
||||
if_host.Up()
|
||||
|
||||
try:
|
||||
start = time.time()
|
||||
while isinstance(if_container, str) and time.time() - start < 10:
|
||||
try:
|
||||
if_container = interface.GetInterface(LIBRARY, if_container)
|
||||
if_container.up()
|
||||
if_container.Up()
|
||||
except KeyError:
|
||||
time.sleep(0.5)
|
||||
if isinstance(if_container, str):
|
||||
@@ -164,15 +164,10 @@ def create_endpoint():
|
||||
'AddressIPv6': ''
|
||||
}
|
||||
|
||||
# !!!
|
||||
# if 'MacAddress' in req_iface and req_iface['MacAddress']:
|
||||
# (if_container
|
||||
# .set('address', req_iface['MacAddress'])
|
||||
# .commit())
|
||||
# else:
|
||||
# res_iface['MacAddress'] = if_container['address']
|
||||
# !!!
|
||||
res_iface['MacAddress'] = if_container['address']
|
||||
if 'MacAddress' in req_iface and req_iface['MacAddress']:
|
||||
if_container.SetAddress(req_iface['MacAddress'])
|
||||
else:
|
||||
res_iface['MacAddress'] = if_container['address']
|
||||
|
||||
def try_addr(type_):
|
||||
addr = None
|
||||
|
||||
Reference in New Issue
Block a user