コード例 #1
0
ファイル: imagebackend.py プロジェクト: Drooids/nova
 def remove_volume_on_error(self, path):
     try:
         yield
     except Exception:
         with excutils.save_and_reraise_exception():
             if self.ephemeral_key_uuid is None:
                 lvm.remove_volumes([path])
             else:
                 dmcrypt.delete_volume(path.rpartition('/')[2])
                 lvm.remove_volumes([self.lv_path])
コード例 #2
0
ファイル: imagebackend.py プロジェクト: aishi1979/studyKilo
 def remove_volume_on_error(self, path):
     try:
         yield
     except Exception:
         with excutils.save_and_reraise_exception():
             if self.ephemeral_key_uuid is None:
                 lvm.remove_volumes([path])
             else:
                 dmcrypt.delete_volume(path.rpartition('/')[2])
                 lvm.remove_volumes([self.lv_path])
コード例 #3
0
ファイル: test_dmcrypt.py プロジェクト: keiichishima/nova
    def test_delete_volume(self):
        expected_commands = [("cryptsetup", "remove", self.TARGET)]
        dmcrypt.delete_volume(self.TARGET)

        self.assertEqual(expected_commands, self.executes)
コード例 #4
0
ファイル: test_dmcrypt.py プロジェクト: liunian0o0/nova-1
    def test_delete_volume(self):
        expected_commands = [('cryptsetup', 'remove', self.TARGET)]
        dmcrypt.delete_volume(self.TARGET)

        self.assertEqual(expected_commands, self.executes)