- # ignore input data
- r, c = self.config['of_thread'].insert_task("clear-all")
- if r < 0:
- raise ovimException(str(c), -r)
+
+ if not ofc_id:
+ if 'Default' in self.config['ofcs_thread']:
+ r, c = self.config['ofcs_thread']['Default'].insert_task("clear-all")
+ else:
+ raise ovimException("Default Openflow controller not not running", HTTP_Not_Found)
+
+ elif ofc_id in self.config['ofcs_thread']:
+ r, c = self.config['ofcs_thread'][ofc_id].insert_task("clear-all")
+
+ # ignore input data
+ if r < 0:
+ raise ovimException(str(c), -r)
+ else:
+ raise ovimException("Openflow controller not found with ofc_id={}".format(ofc_id), HTTP_Not_Found)