Skip to content

Instantly share code, notes, and snippets.

@noelbk
Created March 5, 2014 17:46
Show Gist options
  • Save noelbk/9372473 to your computer and use it in GitHub Desktop.
Save noelbk/9372473 to your computer and use it in GitHub Desktop.
Exception converted to print in contrail
Here's a nugget from quantum/plugins/contrail/ctdb/config_db.py:
1 def _security_group_entries_list_sg(self, sg_id):
2 try:
3 sg_uuid = str(uuid.UUID(project_id))
4 except Exception:
5 print "Error in converting SG uuid %s" % (sg_id)
6
7 resp_dict = self._vnc_lib.security_groups_list(parent_id=project_uuid)
3: project_id is not defined
4: the undefined variable exception is swallowed here and converted to print
7: project_uuid is still undefined, so throws exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment