Revision bd39b6bb test/py/mocks.py
b/test/py/mocks.py | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import os |
26 | 26 |
|
27 |
from ganeti import utils |
|
28 | 27 |
from ganeti import netutils |
29 | 28 |
|
30 | 29 |
|
... | ... | |
37 | 36 |
"vYdB2nQds7/+Bf40C/OpbvnAxna1kVtgFHAo18cQ==") |
38 | 37 |
|
39 | 38 |
|
40 |
class FakeConfig: |
|
39 |
class FakeConfig(object):
|
|
41 | 40 |
"""Fake configuration object""" |
42 | 41 |
|
43 | 42 |
def IsCluster(self): |
... | ... | |
61 | 60 |
def GetMasterNodeName(self): |
62 | 61 |
return netutils.Hostname.GetSysName() |
63 | 62 |
|
64 |
def GetDefaultIAllocator(Self):
|
|
63 |
def GetDefaultIAllocator(self):
|
|
65 | 64 |
return "testallocator" |
66 | 65 |
|
67 | 66 |
def GetNodeName(self, node_uuid): |
... | ... | |
74 | 73 |
return map(self.GetNodeName, node_uuids) |
75 | 74 |
|
76 | 75 |
|
77 |
class FakeProc: |
|
76 |
class FakeProc(object):
|
|
78 | 77 |
"""Fake processor object""" |
79 | 78 |
|
80 | 79 |
def Log(self, msg, *args, **kwargs): |
... | ... | |
90 | 89 |
pass |
91 | 90 |
|
92 | 91 |
|
93 |
class FakeGLM: |
|
92 |
class FakeGLM(object):
|
|
94 | 93 |
"""Fake global lock manager object""" |
95 | 94 |
|
96 |
def list_owned(self, level):
|
|
95 |
def list_owned(self, _):
|
|
97 | 96 |
return set() |
98 | 97 |
|
99 | 98 |
|
100 |
class FakeContext: |
|
99 |
class FakeContext(object):
|
|
101 | 100 |
"""Fake context object""" |
102 | 101 |
|
103 | 102 |
def __init__(self): |
Also available in: Unified diff