Revision 876fb142
b/autotools/build-bash-completion | ||
---|---|---|
252 | 252 |
sw.Write("return") |
253 | 253 |
|
254 | 254 |
|
255 |
class CompletionWriter: |
|
255 |
class CompletionWriter(object):
|
|
256 | 256 |
"""Command completion writer class. |
257 | 257 |
|
258 | 258 |
""" |
b/daemons/import-export | ||
---|---|---|
99 | 99 |
return child_logger |
100 | 100 |
|
101 | 101 |
|
102 |
class StatusFile: |
|
102 |
class StatusFile(object):
|
|
103 | 103 |
"""Status file manager. |
104 | 104 |
|
105 | 105 |
""" |
b/lib/backend.py | ||
---|---|---|
1722 | 1722 |
logging.info("Instance %s not running, doing nothing", iname) |
1723 | 1723 |
return |
1724 | 1724 |
|
1725 |
class _TryShutdown: |
|
1725 |
class _TryShutdown(object):
|
|
1726 | 1726 |
def __init__(self): |
1727 | 1727 |
self.tried_once = False |
1728 | 1728 |
|
b/lib/cli.py | ||
---|---|---|
345 | 345 |
} |
346 | 346 |
|
347 | 347 |
|
348 |
class _Argument: |
|
348 |
class _Argument(object):
|
|
349 | 349 |
def __init__(self, min=0, max=None): # pylint: disable=W0622 |
350 | 350 |
self.min = min |
351 | 351 |
self.max = max |
... | ... | |
2108 | 2108 |
raise errors.OpExecError(result) |
2109 | 2109 |
|
2110 | 2110 |
|
2111 |
class JobPollCbBase: |
|
2111 |
class JobPollCbBase(object):
|
|
2112 | 2112 |
"""Base class for L{GenericPollJob} callbacks. |
2113 | 2113 |
|
2114 | 2114 |
""" |
... | ... | |
2136 | 2136 |
raise NotImplementedError() |
2137 | 2137 |
|
2138 | 2138 |
|
2139 |
class JobPollReportCbBase: |
|
2139 |
class JobPollReportCbBase(object):
|
|
2140 | 2140 |
"""Base class for L{GenericPollJob} reporting callbacks. |
2141 | 2141 |
|
2142 | 2142 |
""" |
... | ... | |
2790 | 2790 |
return 0 |
2791 | 2791 |
|
2792 | 2792 |
|
2793 |
class _RunWhileClusterStoppedHelper: |
|
2793 |
class _RunWhileClusterStoppedHelper(object):
|
|
2794 | 2794 |
"""Helper class for L{RunWhileClusterStopped} to simplify state management |
2795 | 2795 |
|
2796 | 2796 |
""" |
... | ... | |
3073 | 3073 |
raise NotImplementedError("Can't format column type '%s'" % fdef.kind) |
3074 | 3074 |
|
3075 | 3075 |
|
3076 |
class _QueryColumnFormatter: |
|
3076 |
class _QueryColumnFormatter(object):
|
|
3077 | 3077 |
"""Callable class for formatting fields of a query. |
3078 | 3078 |
|
3079 | 3079 |
""" |
... | ... | |
3347 | 3347 |
return constants.EXIT_SUCCESS |
3348 | 3348 |
|
3349 | 3349 |
|
3350 |
class TableColumn: |
|
3350 |
class TableColumn(object):
|
|
3351 | 3351 |
"""Describes a column for L{FormatTable}. |
3352 | 3352 |
|
3353 | 3353 |
""" |
b/lib/client/gnt_cluster.py | ||
---|---|---|
1369 | 1369 |
return True |
1370 | 1370 |
|
1371 | 1371 |
|
1372 |
class _RunWhenNodesReachableHelper: |
|
1372 |
class _RunWhenNodesReachableHelper(object):
|
|
1373 | 1373 |
"""Helper class to make shared internal state sharing easier. |
1374 | 1374 |
|
1375 | 1375 |
@ivar success: Indicates if all action_cb calls were successful |
b/lib/cmdlib/base.py | ||
---|---|---|
31 | 31 |
from ganeti.cmdlib.common import ExpandInstanceUuidAndName |
32 | 32 |
|
33 | 33 |
|
34 |
class ResultWithJobs: |
|
34 |
class ResultWithJobs(object):
|
|
35 | 35 |
"""Data container for LU results with jobs. |
36 | 36 |
|
37 | 37 |
Instances of this class returned from L{LogicalUnit.Exec} will be recognized |
... | ... | |
426 | 426 |
raise AssertionError("PreparePostHookNodes called for NoHooksLU") |
427 | 427 |
|
428 | 428 |
|
429 |
class Tasklet: |
|
429 |
class Tasklet(object):
|
|
430 | 430 |
"""Tasklet base class. |
431 | 431 |
|
432 | 432 |
Tasklets are subcomponents for LUs. LUs can consist entirely of tasklets or |
... | ... | |
472 | 472 |
raise NotImplementedError |
473 | 473 |
|
474 | 474 |
|
475 |
class QueryBase: |
|
475 |
class QueryBase(object):
|
|
476 | 476 |
"""Base for query utility classes. |
477 | 477 |
|
478 | 478 |
""" |
b/lib/cmdlib/instance.py | ||
---|---|---|
2095 | 2095 |
return ResultWithJobs(jobs, **self._ConstructPartialResult()) |
2096 | 2096 |
|
2097 | 2097 |
|
2098 |
class _InstNicModPrivate: |
|
2098 |
class _InstNicModPrivate(object):
|
|
2099 | 2099 |
"""Data structure for network interface modifications. |
2100 | 2100 |
|
2101 | 2101 |
Used by L{LUInstanceSetParams}. |
b/lib/confd/client.py | ||
---|---|---|
106 | 106 |
self.rcvd = set() |
107 | 107 |
|
108 | 108 |
|
109 |
class ConfdClient: |
|
109 |
class ConfdClient(object):
|
|
110 | 110 |
"""Send queries to confd, and get back answers. |
111 | 111 |
|
112 | 112 |
Since the confd model works by querying multiple master candidates, and |
... | ... | |
462 | 462 |
raise errors.ConfdClientError("Invalid request type") |
463 | 463 |
|
464 | 464 |
|
465 |
class ConfdFilterCallback: |
|
465 |
class ConfdFilterCallback(object):
|
|
466 | 466 |
"""Callback that calls another callback, but filters duplicate results. |
467 | 467 |
|
468 | 468 |
@ivar consistent: a dictionary indexed by salt; for each salt, if |
... | ... | |
567 | 567 |
self._callback(up) |
568 | 568 |
|
569 | 569 |
|
570 |
class ConfdCountingCallback: |
|
570 |
class ConfdCountingCallback(object):
|
|
571 | 571 |
"""Callback that calls another callback, and counts the answers |
572 | 572 |
|
573 | 573 |
""" |
... | ... | |
629 | 629 |
self._callback(up) |
630 | 630 |
|
631 | 631 |
|
632 |
class StoreResultCallback: |
|
632 |
class StoreResultCallback(object):
|
|
633 | 633 |
"""Callback that simply stores the most recent answer. |
634 | 634 |
|
635 | 635 |
@ivar _answers: dict of salt to (have_answer, reply) |
b/lib/config.py | ||
---|---|---|
75 | 75 |
data['version']) |
76 | 76 |
|
77 | 77 |
|
78 |
class TemporaryReservationManager: |
|
78 |
class TemporaryReservationManager(object):
|
|
79 | 79 |
"""A temporary resource reservation manager. |
80 | 80 |
|
81 | 81 |
This is used to reserve resources in a job, before using them, making sure |
b/lib/daemon.py | ||
---|---|---|
457 | 457 |
self.out_socket.send(chr(0)) |
458 | 458 |
|
459 | 459 |
|
460 |
class _ShutdownCheck: |
|
460 |
class _ShutdownCheck(object):
|
|
461 | 461 |
"""Logic for L{Mainloop} shutdown. |
462 | 462 |
|
463 | 463 |
""" |
b/lib/http/client.py | ||
---|---|---|
174 | 174 |
return _PendingRequest(curl, req, resp_buffer.getvalue) |
175 | 175 |
|
176 | 176 |
|
177 |
class _PendingRequest: |
|
177 |
class _PendingRequest(object):
|
|
178 | 178 |
def __init__(self, curl, req, resp_buffer_read): |
179 | 179 |
"""Initializes this class. |
180 | 180 |
|
... | ... | |
233 | 233 |
req.completion_cb(req) |
234 | 234 |
|
235 | 235 |
|
236 |
class _NoOpRequestMonitor: # pylint: disable=W0232 |
|
236 |
class _NoOpRequestMonitor(object): # pylint: disable=W0232
|
|
237 | 237 |
"""No-op request monitor. |
238 | 238 |
|
239 | 239 |
""" |
... | ... | |
245 | 245 |
Disable = acquire |
246 | 246 |
|
247 | 247 |
|
248 |
class _PendingRequestMonitor: |
|
248 |
class _PendingRequestMonitor(object):
|
|
249 | 249 |
_LOCK = "_lock" |
250 | 250 |
|
251 | 251 |
def __init__(self, owner, pending_fn): |
b/lib/jqueue.py | ||
---|---|---|
546 | 546 |
|
547 | 547 |
|
548 | 548 |
class _OpExecCallbacks(mcpu.OpExecCbBase): |
549 |
|
|
549 | 550 |
def __init__(self, queue, job, op): |
550 | 551 |
"""Initializes this class. |
551 | 552 |
|
... | ... | |
557 | 558 |
@param op: OpCode |
558 | 559 |
|
559 | 560 |
""" |
561 |
super(_OpExecCallbacks, self).__init__() |
|
562 |
|
|
560 | 563 |
assert queue, "Queue is missing" |
561 | 564 |
assert job, "Job is missing" |
562 | 565 |
assert op, "Opcode is missing" |
b/lib/locking.py | ||
---|---|---|
969 | 969 |
""" |
970 | 970 |
|
971 | 971 |
|
972 |
class LockSet: |
|
972 |
class LockSet(object):
|
|
973 | 973 |
"""Implements a set of locks. |
974 | 974 |
|
975 | 975 |
This abstraction implements a set of shared locks for the same resource type, |
b/lib/masterd/instance.py | ||
---|---|---|
659 | 659 |
return utils.CommaJoin(parts) |
660 | 660 |
|
661 | 661 |
|
662 |
class ImportExportLoop: |
|
662 |
class ImportExportLoop(object):
|
|
663 | 663 |
MIN_DELAY = 1.0 |
664 | 664 |
MAX_DELAY = 20.0 |
665 | 665 |
|
... | ... | |
1140 | 1140 |
finished_fn() |
1141 | 1141 |
|
1142 | 1142 |
|
1143 |
class ExportInstanceHelper: |
|
1143 |
class ExportInstanceHelper(object):
|
|
1144 | 1144 |
def __init__(self, lu, feedback_fn, instance): |
1145 | 1145 |
"""Initializes this class. |
1146 | 1146 |
|
b/lib/mcpu.py | ||
---|---|---|
139 | 139 |
return timeout |
140 | 140 |
|
141 | 141 |
|
142 |
class OpExecCbBase: # pylint: disable=W0232 |
|
142 |
class OpExecCbBase(object): # pylint: disable=W0232
|
|
143 | 143 |
"""Base class for OpCode execution callbacks. |
144 | 144 |
|
145 | 145 |
""" |
b/lib/netutils.py | ||
---|---|---|
157 | 157 |
(err[0], err[2]), errors.ECODE_RESOLVER) |
158 | 158 |
|
159 | 159 |
|
160 |
class Hostname: |
|
160 |
class Hostname(object):
|
|
161 | 161 |
"""Class implementing resolver and hostname functionality. |
162 | 162 |
|
163 | 163 |
""" |
b/lib/query.py | ||
---|---|---|
201 | 201 |
return [fdef for (fdef, _, _, _) in fielddefs] |
202 | 202 |
|
203 | 203 |
|
204 |
class _FilterHints: |
|
204 |
class _FilterHints(object):
|
|
205 | 205 |
"""Class for filter analytics. |
206 | 206 |
|
207 | 207 |
When filters are used, the user of the L{Query} class usually doesn't know |
... | ... | |
387 | 387 |
] |
388 | 388 |
|
389 | 389 |
|
390 |
class _FilterCompilerHelper: |
|
390 |
class _FilterCompilerHelper(object):
|
|
391 | 391 |
"""Converts a query filter to a callable usable for filtering. |
392 | 392 |
|
393 | 393 |
""" |
... | ... | |
655 | 655 |
return _FilterCompilerHelper(fields)(hints, qfilter) |
656 | 656 |
|
657 | 657 |
|
658 |
class Query: |
|
658 |
class Query(object):
|
|
659 | 659 |
def __init__(self, fieldlist, selected, qfilter=None, namefield=None): |
660 | 660 |
"""Initializes this class. |
661 | 661 |
|
... | ... | |
1087 | 1087 |
] |
1088 | 1088 |
|
1089 | 1089 |
|
1090 |
class NodeQueryData: |
|
1090 |
class NodeQueryData(object):
|
|
1091 | 1091 |
"""Data container for node data queries. |
1092 | 1092 |
|
1093 | 1093 |
""" |
... | ... | |
1406 | 1406 |
return _PrepareFieldList(fields, []) |
1407 | 1407 |
|
1408 | 1408 |
|
1409 |
class InstanceQueryData: |
|
1409 |
class InstanceQueryData(object):
|
|
1410 | 1410 |
"""Data container for instance data queries. |
1411 | 1411 |
|
1412 | 1412 |
""" |
... | ... | |
2236 | 2236 |
return _PrepareFieldList(fields, aliases) |
2237 | 2237 |
|
2238 | 2238 |
|
2239 |
class LockQueryData: |
|
2239 |
class LockQueryData(object):
|
|
2240 | 2240 |
"""Data container for lock data queries. |
2241 | 2241 |
|
2242 | 2242 |
""" |
... | ... | |
2298 | 2298 |
], []) |
2299 | 2299 |
|
2300 | 2300 |
|
2301 |
class GroupQueryData: |
|
2301 |
class GroupQueryData(object):
|
|
2302 | 2302 |
"""Data container for node group data queries. |
2303 | 2303 |
|
2304 | 2304 |
""" |
... | ... | |
2658 | 2658 |
} |
2659 | 2659 |
|
2660 | 2660 |
|
2661 |
class ClusterQueryData: |
|
2661 |
class ClusterQueryData(object):
|
|
2662 | 2662 |
def __init__(self, cluster, nodes, drain_flag, watcher_pause): |
2663 | 2663 |
"""Initializes this class. |
2664 | 2664 |
|
... | ... | |
2730 | 2730 |
("name", "cluster_name")]) |
2731 | 2731 |
|
2732 | 2732 |
|
2733 |
class NetworkQueryData: |
|
2733 |
class NetworkQueryData(object):
|
|
2734 | 2734 |
"""Data container for network data queries. |
2735 | 2735 |
|
2736 | 2736 |
""" |
b/lib/rapi/connector.py | ||
---|---|---|
43 | 43 |
CONNECTOR = {} |
44 | 44 |
|
45 | 45 |
|
46 |
class Mapper: |
|
46 |
class Mapper(object):
|
|
47 | 47 |
"""Map resource to method. |
48 | 48 |
|
49 | 49 |
""" |
b/lib/rapi/testutils.py | ||
---|---|---|
145 | 145 |
return "\n".join(headers) |
146 | 146 |
|
147 | 147 |
|
148 |
class FakeCurl: |
|
148 |
class FakeCurl(object):
|
|
149 | 149 |
"""Fake cURL object. |
150 | 150 |
|
151 | 151 |
""" |
... | ... | |
206 | 206 |
writefn(resp_body) |
207 | 207 |
|
208 | 208 |
|
209 |
class _RapiMock: |
|
209 |
class _RapiMock(object):
|
|
210 | 210 |
"""Mocking out the RAPI server parts. |
211 | 211 |
|
212 | 212 |
""" |
... | ... | |
249 | 249 |
return (resp_msg.start_line.code, resp_msg.headers, resp_msg.body) |
250 | 250 |
|
251 | 251 |
|
252 |
class _TestLuxiTransport: |
|
252 |
class _TestLuxiTransport(object):
|
|
253 | 253 |
"""Mocked LUXI transport. |
254 | 254 |
|
255 | 255 |
Raises L{errors.RapiTestResult} for all method calls, no matter the |
... | ... | |
282 | 282 |
raise errors.RapiTestResult |
283 | 283 |
|
284 | 284 |
|
285 |
class _LuxiCallRecorder: |
|
285 |
class _LuxiCallRecorder(object):
|
|
286 | 286 |
"""Records all called LUXI client methods. |
287 | 287 |
|
288 | 288 |
""" |
... | ... | |
327 | 327 |
return NotImplemented |
328 | 328 |
|
329 | 329 |
|
330 |
class InputTestClient: |
|
330 |
class InputTestClient(object):
|
|
331 | 331 |
"""Test version of RAPI client. |
332 | 332 |
|
333 | 333 |
Instances of this class can be used to test input arguments for RAPI client |
b/lib/runtime.py | ||
---|---|---|
68 | 68 |
raise errors.ConfigurationError("Group '%s' not found (%s)" % (group, err)) |
69 | 69 |
|
70 | 70 |
|
71 |
class GetentResolver: |
|
71 |
class GetentResolver(object):
|
|
72 | 72 |
"""Resolves Ganeti uids and gids by name. |
73 | 73 |
|
74 | 74 |
@ivar masterd_uid: The resolved uid of the masterd user |
b/lib/server/masterd.py | ||
---|---|---|
143 | 143 |
self.server.request_workers.AddTask((self.server, message, self)) |
144 | 144 |
|
145 | 145 |
|
146 |
class _MasterShutdownCheck: |
|
146 |
class _MasterShutdownCheck(object):
|
|
147 | 147 |
"""Logic for master daemon shutdown. |
148 | 148 |
|
149 | 149 |
""" |
... | ... | |
267 | 267 |
self.context.jobqueue.Shutdown() |
268 | 268 |
|
269 | 269 |
|
270 |
class ClientOps: |
|
270 |
class ClientOps(object):
|
|
271 | 271 |
"""Class holding high-level client operations.""" |
272 | 272 |
def __init__(self, server): |
273 | 273 |
self.server = server |
b/lib/server/rapi.py | ||
---|---|---|
205 | 205 |
return serializer.DumpJson(result) |
206 | 206 |
|
207 | 207 |
|
208 |
class RapiUsers: |
|
208 |
class RapiUsers(object):
|
|
209 | 209 |
def __init__(self): |
210 | 210 |
"""Initializes this class. |
211 | 211 |
|
b/lib/ssh.py | ||
---|---|---|
106 | 106 |
for (kind, (privkey, pubkey, _)) in result)) |
107 | 107 |
|
108 | 108 |
|
109 |
class SshRunner: |
|
109 |
class SshRunner(object):
|
|
110 | 110 |
"""Wrapper for SSH commands. |
111 | 111 |
|
112 | 112 |
""" |
b/lib/storage/container.py | ||
---|---|---|
43 | 43 |
return int(round(float(value), 0)) |
44 | 44 |
|
45 | 45 |
|
46 |
class _Base: |
|
46 |
class _Base(object):
|
|
47 | 47 |
"""Base class for storage abstraction. |
48 | 48 |
|
49 | 49 |
""" |
... | ... | |
95 | 95 |
@param paths: List of file storage paths |
96 | 96 |
|
97 | 97 |
""" |
98 |
super(FileStorage, self).__init__() |
|
99 |
|
|
98 | 100 |
self._paths = paths |
99 | 101 |
|
100 | 102 |
def List(self, name, fields): |
b/lib/storage/drbd.py | ||
---|---|---|
711 | 711 |
base.ThrowError("drbd%d: DRBD disk missing network info in" |
712 | 712 |
" DisconnectNet()", self.minor) |
713 | 713 |
|
714 |
class _DisconnectStatus: |
|
714 |
class _DisconnectStatus(object):
|
|
715 | 715 |
def __init__(self, ever_disconnected): |
716 | 716 |
self.ever_disconnected = ever_disconnected |
717 | 717 |
|
b/lib/utils/io.py | ||
---|---|---|
71 | 71 |
return detail |
72 | 72 |
|
73 | 73 |
|
74 |
class FileStatHelper: |
|
74 |
class FileStatHelper(object):
|
|
75 | 75 |
"""Helper to store file handle's C{fstat}. |
76 | 76 |
|
77 | 77 |
Useful in combination with L{ReadFile}'s C{preread} parameter. |
b/lib/utils/text.py | ||
---|---|---|
246 | 246 |
return ["/bin/sh", "-c", " && ".join(ShellQuoteArgs(c) for c in cmdlist)] |
247 | 247 |
|
248 | 248 |
|
249 |
class ShellWriter: |
|
249 |
class ShellWriter(object):
|
|
250 | 250 |
"""Helper class to write scripts with indentation. |
251 | 251 |
|
252 | 252 |
""" |
... | ... | |
530 | 530 |
return " ".join(parts) |
531 | 531 |
|
532 | 532 |
|
533 |
class LineSplitter: |
|
533 |
class LineSplitter(object):
|
|
534 | 534 |
"""Splits data chunks into lines separated by newline. |
535 | 535 |
|
536 | 536 |
Instances provide a file-like interface. |
b/lib/watcher/__init__.py | ||
---|---|---|
158 | 158 |
cli.SubmitOpCode(op, cl=cl) |
159 | 159 |
|
160 | 160 |
|
161 |
class Node: |
|
161 |
class Node(object):
|
|
162 | 162 |
"""Data container representing cluster node. |
163 | 163 |
|
164 | 164 |
""" |
b/qa/qa_config.py | ||
---|---|---|
666 | 666 |
return GetConfig().get(name, default=default) |
667 | 667 |
|
668 | 668 |
|
669 |
class Either: |
|
669 |
class Either(object):
|
|
670 | 670 |
def __init__(self, tests): |
671 | 671 |
"""Initializes this class. |
672 | 672 |
|
b/test/py/cmdlib/testsupport/processor_mock.py | ||
---|---|---|
33 | 33 |
|
34 | 34 |
""" |
35 | 35 |
def __init__(self, processor): |
36 |
super(LogRecordingCallback, self).__init__() |
|
37 |
|
|
36 | 38 |
self.processor = processor |
37 | 39 |
|
38 | 40 |
def Feedback(self, *args): |
b/test/py/lockperf.py | ||
---|---|---|
54 | 54 |
return (opts, args) |
55 | 55 |
|
56 | 56 |
|
57 |
class State: |
|
57 |
class State(object):
|
|
58 | 58 |
def __init__(self, thread_count): |
59 | 59 |
"""Initializes this class. |
60 | 60 |
|
b/test/py/mocks.py | ||
---|---|---|
104 | 104 |
self.glm = FakeGLM() |
105 | 105 |
|
106 | 106 |
|
107 |
class FakeGetentResolver: |
|
107 |
class FakeGetentResolver(object):
|
|
108 | 108 |
"""Fake runtime.GetentResolver""" |
109 | 109 |
|
110 | 110 |
def __init__(self): |
b/tools/move-instance | ||
---|---|---|
133 | 133 |
""" |
134 | 134 |
|
135 | 135 |
|
136 |
class RapiClientFactory: |
|
136 |
class RapiClientFactory(object):
|
|
137 | 137 |
"""Factory class for creating RAPI clients. |
138 | 138 |
|
139 | 139 |
@ivar src_cluster_name: Source cluster name |
Also available in: Unified diff