1#    Licensed under the Apache License, Version 2.0 (the "License"); you may
2#    not use this file except in compliance with the License. You may obtain
3#    a copy of the License at
4#
5#         http://www.apache.org/licenses/LICENSE-2.0
6#
7#    Unless required by applicable law or agreed to in writing, software
8#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10#    License for the specific language governing permissions and limitations
11#    under the License.
12
13
14class FakeBrickLVM(object):
15    """Logs and records calls, for unit tests."""
16
17    def __init__(self, vg_name, create, pv_list, vtype, execute=None):
18        super(FakeBrickLVM, self).__init__()
19        self.vg_size = '5.00'
20        self.vg_free_space = '5.00'
21        self.vg_name = vg_name
22
23    def supports_thin_provisioning():
24        return False
25
26    def get_volumes(self):
27        return ['fake-volume']
28
29    def get_volume(self, name):
30        return ['name']
31
32    def get_all_physical_volumes(vg_name=None):
33        return []
34
35    def get_physical_volumes(self):
36        return []
37
38    def update_volume_group_info(self):
39        pass
40
41    def create_thin_pool(self, name=None, size_str=0):
42        pass
43
44    def create_volume(self, name, size_str, lv_type='default', mirror_count=0):
45        pass
46
47    def create_lv_snapshot(self, name, source_lv_name, lv_type='default'):
48        pass
49
50    def delete(self, name):
51        pass
52
53    def revert(self, snapshot_name):
54        pass
55
56    def lv_has_snapshot(self, name):
57        return False
58
59    def activate_lv(self, lv, is_snapshot=False, permanent=False):
60        pass
61
62    def rename_volume(self, lv_name, new_name):
63        pass
64