Revision e11ddf13
b/lib/confd/client.py | ||
---|---|---|
130 | 130 |
@param peers: list of peer nodes |
131 | 131 |
|
132 | 132 |
""" |
133 |
# we are actually called from init, so: |
|
134 |
# pylint: disable-msg=W0201 |
|
133 | 135 |
if not isinstance(peers, list): |
134 | 136 |
raise errors.ProgrammerError("peers must be a list") |
135 | 137 |
self._peers = peers |
b/lib/objects.py | ||
---|---|---|
48 | 48 |
_TIMESTAMPS = ["ctime", "mtime"] |
49 | 49 |
_UUID = ["uuid"] |
50 | 50 |
|
51 |
def FillDict(defaults_dict, custom_dict, skip_keys=[]):
|
|
51 |
def FillDict(defaults_dict, custom_dict, skip_keys=None):
|
|
52 | 52 |
"""Basic function to apply settings on top a default dict. |
53 | 53 |
|
54 | 54 |
@type defaults_dict: dict |
... | ... | |
63 | 63 |
""" |
64 | 64 |
ret_dict = copy.deepcopy(defaults_dict) |
65 | 65 |
ret_dict.update(custom_dict) |
66 |
for k in skip_keys: |
|
67 |
try: |
|
68 |
del ret_dict[k] |
|
69 |
except KeyError: |
|
70 |
pass |
|
66 |
if skip_keys: |
|
67 |
for k in skip_keys: |
|
68 |
try: |
|
69 |
del ret_dict[k] |
|
70 |
except KeyError: |
|
71 |
pass |
|
71 | 72 |
return ret_dict |
72 | 73 |
|
73 | 74 |
|
b/lib/rapi/connector.py | ||
---|---|---|
46 | 46 |
"""Map resource to method. |
47 | 47 |
|
48 | 48 |
""" |
49 |
def __init__(self, connector=CONNECTOR):
|
|
49 |
def __init__(self, connector=None):
|
|
50 | 50 |
"""Resource mapper constructor. |
51 | 51 |
|
52 | 52 |
@param connector: a dictionary, mapping method name with URL path regexp |
53 | 53 |
|
54 | 54 |
""" |
55 |
if connector is None: |
|
56 |
connector = CONNECTOR |
|
55 | 57 |
self._connector = connector |
56 | 58 |
|
57 | 59 |
def getController(self, uri): |
Also available in: Unified diff