def mayastor_nexus(mayastor_instance, nexus_uuid, source_uri): nexus = mayastor_instance.ms.CreateNexus( pb.CreateNexusRequest(uuid=nexus_uuid, size=megabytes(64), children=[source_uri])) yield nexus mayastor_instance.ms.DestroyNexus(pb.DestroyNexusRequest(uuid=nexus_uuid))
def nexus_destroy(self, uuid): """Destroy the nexus.""" return self.ms.DestroyNexus(pb.DestroyNexusRequest(uuid=uuid))
def destroy(uuid): mayastor_mod[nexus_instance].ms.DestroyNexus( pb.DestroyNexusRequest(uuid=uuid)) del created_nexuses[uuid]
def created_nexuses(mayastor_mod, nexus_instance): nexuses = {} yield nexuses for uuid in nexuses.keys(): mayastor_mod[nexus_instance].ms.DestroyNexus( pb.DestroyNexusRequest(uuid=uuid))
def destroying_a_nexus_that_does_not_exist(mayastor_mod, nexus_instance): mayastor_mod[nexus_instance].ms.DestroyNexus( pb.DestroyNexusRequest(uuid="e6629036-1376-494d-bbc2-0b6345ab10df") )
def destroying_the_nexus(mayastor_mod, nexus_instance, nexus_uuid, created_nexuses): mayastor_mod[nexus_instance].ms.DestroyNexus( pb.DestroyNexusRequest(uuid=nexus_uuid) ) del created_nexuses[nexus_uuid]