Differentiate between StaleRevision error to other manager errors

Change-Id: Ia176520504a1e2536fd839c9fe0cf5ac4d853a5d
This commit is contained in:
Roey Chen 2016-02-16 01:23:55 -08:00
parent deef820935
commit c11638095a

View File

@ -126,6 +126,8 @@ def add_nsgroup_member(nsgroup_id, target_type, target_id):
members = {'members': [member_expr]}
try:
return _update_nsgroup_with_members(nsgroup_id, members, ADD_MEMBERS)
except nsx_exc.StaleRevision:
raise
except nsx_exc.ManagerError:
# REVISIT(roeyc): A ManagerError might have been raised for a
# different reason, e.g - NSGroup does not exists.