Revision 05f1ebf3 lib/confd/server.py
b/lib/confd/server.py | ||
---|---|---|
34 | 34 |
from ganeti import errors |
35 | 35 |
from ganeti import utils |
36 | 36 |
from ganeti import serializer |
37 |
from ganeti import ssconf |
|
37 | 38 |
|
38 | 39 |
from ganeti.confd import querylib |
39 | 40 |
|
... | ... | |
41 | 42 |
class ConfdProcessor(object): |
42 | 43 |
"""A processor for confd requests. |
43 | 44 |
|
45 |
@ivar reader: confd SimpleConfigReader |
|
46 |
|
|
44 | 47 |
""" |
45 | 48 |
DISPATCH_TABLE = { |
46 | 49 |
constants.CONFD_REQ_PING: querylib.PingQuery, |
... | ... | |
49 | 52 |
querylib.InstanceIpToNodePrimaryIpQuery, |
50 | 53 |
} |
51 | 54 |
|
52 |
def __init__(self, reader):
|
|
55 |
def __init__(self): |
|
53 | 56 |
"""Constructor for ConfdProcessor |
54 | 57 |
|
55 |
@type reader: L{ssconf.SimpleConfigReader} |
|
56 |
@param reader: ConfigReader to use to access the config |
|
57 |
|
|
58 | 58 |
""" |
59 |
self.reader = reader
|
|
59 |
self.reader = ssconf.SimpleConfigReader()
|
|
60 | 60 |
self.hmac_key = utils.ReadFile(constants.HMAC_CLUSTER_KEY) |
61 | 61 |
assert \ |
62 | 62 |
not constants.CONFD_REQS.symmetric_difference(self.DISPATCH_TABLE), \ |
Also available in: Unified diff