projects
/
osm
/
openvim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set network to BUILD when added/deleted ports to it until reconfigured
[osm/openvim.git]
/
osm_openvim
/
ovim.py
diff --git
a/osm_openvim/ovim.py
b/osm_openvim/ovim.py
index
9cfecca
..
213676a
100755
(executable)
--- a/
osm_openvim/ovim.py
+++ b/
osm_openvim/ovim.py
@@
-43,7
+43,7
@@
import openflow_conn
__author__ = "Alfonso Tierno, Leonardo Mirabal"
__date__ = "$06-Feb-2017 12:07:15$"
__author__ = "Alfonso Tierno, Leonardo Mirabal"
__date__ = "$06-Feb-2017 12:07:15$"
-__version__ = "0.5.2
6-r546
"
+__version__ = "0.5.2
7-r547
"
version_date = "Jul 2018"
database_version = 23 #needed database schema version
version_date = "Jul 2018"
database_version = 23 #needed database schema version
@@
-1003,6
+1003,8
@@
class ovim():
del port_data['compute_node']
result, uuid = self.db.new_row('ports', port_data, True, True)
del port_data['compute_node']
result, uuid = self.db.new_row('ports', port_data, True, True)
+ # set net status to BUILD
+ self.db.update_rows('nets', {"status": "BUILD"}, WHERE={'uuid': port_data['net_id']})
if result > 0:
try:
self.net_update_ofc_thread(port_data['net_id'], port_data['ofc_id'])
if result > 0:
try:
self.net_update_ofc_thread(port_data['net_id'], port_data['ofc_id'])
@@
-1071,17
+1073,19
@@
class ovim():
elif result < 0:
raise ovimException("Cannot delete port from database: {}".format(content), http_code=-result)
# update network
elif result < 0:
raise ovimException("Cannot delete port from database: {}".format(content), http_code=-result)
# update network
- net
work
= ports[0].get('net_id', None)
- if net
work
:
+ net
_id
= ports[0].get('net_id', None)
+ if net
_id
:
# change of net.
# change of net.
+ # set net status to BUILD
+ self.db.update_rows('nets', {"status": "BUILD"}, WHERE={'uuid': net_id})
try:
try:
- self.net_update_ofc_thread(net
work
, ofc_id=ports[0]["ofc_id"], switch_dpid=ports[0]["switch_dpid"])
+ self.net_update_ofc_thread(net
_id
, ofc_id=ports[0]["ofc_id"], switch_dpid=ports[0]["switch_dpid"])
except ovimException as e:
except ovimException as e:
- raise ovimException("Cannot insert a task for delete network '{}' {}".format(net
work
, str(e)),
+ raise ovimException("Cannot insert a task for delete network '{}' {}".format(net
_id
, str(e)),
HTTP_Internal_Server_Error)
except Exception as e:
HTTP_Internal_Server_Error)
except Exception as e:
- raise ovimException("Cannot insert a task for delete network '{}' {}".format(net
work
, str(e)),
+ raise ovimException("Cannot insert a task for delete network '{}' {}".format(net
_id
, str(e)),
HTTP_Internal_Server_Error)
return content
HTTP_Internal_Server_Error)
return content