def skip_if_needed(cls):
     from cinderclient.exceptions import NotFound, ClientException
     try:
         cgm = ConsistencygroupManager(get_cinder_v2_client())
         cgm.list()
     except (ImportError, NotFound, ClientException):
         raise SkipTest("This openstack version doesn't support consistency groups")
 def cleanup_cgs():
     cgm = ConsistencygroupManager(get_cinder_v2_client())
     for cg in cgm.list():
         cg.delete()