Skip to content

Commit

Permalink
[Build] Update Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-alegria authored and Jpfonseca committed Nov 19, 2021
1 parent f8b2b1d commit 46495ec
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 45 deletions.
6 changes: 3 additions & 3 deletions E2E_Interdomain/charms/builds/interdomainvdu/.build.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"branch": "refs/heads/main",
"rev": "314e331d662ddd0c26f30d585c3806bd3d4b9cee",
"rev": "f8b2b1d95c47250bdb397ee0dae4a58742dbff9e",
"url": "interdomainvdu"
}
],
Expand Down Expand Up @@ -274,7 +274,7 @@
"reactive/interdomainvdu.py": [
"interdomainvdu",
"static",
"e6bd0cb5a2876da807395b9217fa176af81adbbb0ae842211bb32ec07a728cd7"
"f0a42094ac3b8aaf787ceea8b0bb5575838a10805ef110eb3c34d7b7ebbf4b7c"
],
"reactive/sshproxy.py": [
"interdomainvdu",
Expand Down Expand Up @@ -304,7 +304,7 @@
"version": [
"interdomainvdu",
"dynamic",
"78c780c6a4d6bc042284bfa8fc3c94753f27fb3a03f3812d6260a054c4bb3ba7"
"d849de95bb01569511764cc1a113d196c3c7a242f836747f7c915df2d490fac9"
],
"wheelhouse.txt": [
"interdomainvdu",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,17 @@ def getVnfIp():



# if use_data_interfaces:
# if len(interfacesAndIps)==3:

# vnfMgmtIp=vnfMgmtIp.split("/")[0]
# tunnelAddress=tunnelAddress.split("/")[0]

use_data_interfaces = config['use_data_interfaces']
if use_data_interfaces:
if len(interfacesAndIps)==3:
vnfMgmtIp=vnfMgmtIp.split("/")[0]
tunnelAddress=tunnelAddress.split("/")[0]
vnfIp=str(interfacesAndIps["ens4"])
key="ens4"
config["data_address"]=vnfIp
config["data_interface"]="ens4"
db.set("data_interface", "ens4")
db.flush()
# for key, value in interfacesAndIps.items():
# if str(value) != str(vnfMgmtIp) and str(value) != str(tunnelAddress):
# log("found data interface: "+key+", ip: "+value)
Expand All @@ -506,7 +511,6 @@ def getVnfIp():
# db.set("data_interface", str(key))
# db.flush()
# break

# try:
# log("using interface: "+key)
# cmd = ['sudo tc qdisc add dev {} root cake bandwidth {}mbit'.format(key, bandwidth)]
Expand All @@ -516,40 +520,33 @@ def getVnfIp():
# log('command failed:' + result)
# log('command failed:' + err)
# set_flag('interdomainvdu.tccakeaddinterface.failed')

# result=json.dumps({"vsiId":vsiId,"publicKey": publicKey,"vnfIp":vnfIp, "tunnelId":tunnelId,"vnfMAC":interfacesAndMACs[key], "gwMAC":gwMAC})
# else:
# log('Expecting 3 network interfaces')
# function_fail('Expecting 3 network interfaces')

# else:
vnfMgmtIp=vnfMgmtIp.split("/")[0]
# tunnelAddress=tunnelAddress.split("/")[0]

# for key, value in interfacesAndIps.items():
# if str(value) == str(vnfMgmtIp):
# log("found data interface: "+key+", ip: "+value)
# vnfIp=str(value)
# config["data_address"]=vnfIp
# config["data_interface"]=str(key)
# db.set("data_interface", str(key))
# db.flush()
# break

interfacesAndIps=list(interfacesAndIps.items())

log("using interface: "+str(interfacesAndIps[0])+" with MAC "+interfacesAndMACs[interfacesAndIps[0][0]])
# try:
# cmd = ['sudo tc qdisc add dev {} root cake bandwidth {}mbit'.format(key, bandwidth)]
# result, err = charms.sshproxy._run(cmd)
# log("enabled tc-cake to interface")
# except:
# log('command failed:' + result)
# log('command failed:' + err)
# set_flag('interdomainvdu.tccakeaddinterface.failed')

result=json.dumps({"vsiId":vsiId,"publicKey": publicKey,"vnfIp":vnfMgmtIp, "tunnelId":tunnelId, "vnfMAC":interfacesAndMACs[interfacesAndIps[0][0]], "gwMAC":gwMAC})

result=json.dumps({"vsiId":vsiId,"publicKey": publicKey,"vnfIp":vnfIp, "tunnelId":tunnelId,"vnfMAC":interfacesAndMACs[key], "gwMAC":gwMAC})
else:
log('Expecting 3 network interfaces')
function_fail('Expecting 3 network interfaces')
else:
vnfMgmtIp=vnfMgmtIp.split("/")[0]
tunnelAddress=tunnelAddress.split("/")[0]
# for key, value in interfacesAndIps.items():
# if str(value) == str(vnfMgmtIp):
# log("found data interface: "+key+", ip: "+value)
# vnfIp=str(value)
# config["data_address"]=vnfIp
# config["data_interface"]=str(key)
# db.set("data_interface", str(key))
# db.flush()
# break
interfacesAndIps=list(interfacesAndIps.items())
log("using interface: "+str(interfacesAndIps[0])+" with MAC "+interfacesAndMACs[interfacesAndIps[0][0]])
# try:
# cmd = ['sudo tc qdisc add dev {} root cake bandwidth {}mbit'.format(key, bandwidth)]
# result, err = charms.sshproxy._run(cmd)
# log("enabled tc-cake to interface")
# except:
# log('command failed:' + result)
# log('command failed:' + err)
# set_flag('interdomainvdu.tccakeaddinterface.failed')
result=json.dumps({"vsiId":vsiId,"publicKey": publicKey,"vnfIp":vnfMgmtIp, "tunnelId":tunnelId, "vnfMAC":interfacesAndMACs[interfacesAndIps[0][0]], "gwMAC":gwMAC})

except:
function_fail('command failed:' + err)
Expand Down
2 changes: 1 addition & 1 deletion E2E_Interdomain/charms/builds/interdomainvdu/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
314e331-dirty
f8b2b1d

0 comments on commit 46495ec

Please sign in to comment.