def get_blockdeviceapi_with_cleanup(test_case):
 try:
  api = get_blockdeviceapi()
 except InvalidConfig as e:
  raise SkipTest(str(e))
 test_case.addCleanup(detach_destroy_volumes, api)
 return api

def get_blockdeviceapi_with_cleanup ( test_case ) : try : api = get_blockdeviceapi ( ) except InvalidConfig as e : raise SkipTest ( str ( e ) ) test_case . addCleanup ( detach_destroy_volumes , api ) return api
instantiate an iblockdeviceapi implementation configured to work in the current environment .