Revision b459a848 tools/cfgshell
b/tools/cfgshell | ||
---|---|---|
24 | 24 |
""" |
25 | 25 |
|
26 | 26 |
# functions in this module need to have a given name structure, so: |
27 |
# pylint: disable-msg=C0103
|
|
27 |
# pylint: disable=C0103 |
|
28 | 28 |
|
29 | 29 |
|
30 | 30 |
import optparse |
... | ... | |
54 | 54 |
|
55 | 55 |
""" |
56 | 56 |
# all do_/complete_* functions follow the same API |
57 |
# pylint: disable-msg=W0613
|
|
57 |
# pylint: disable=W0613 |
|
58 | 58 |
prompt = "(/) " |
59 | 59 |
|
60 | 60 |
def __init__(self, cfg_file=None): |
... | ... | |
93 | 93 |
dirs = [] |
94 | 94 |
entries = [] |
95 | 95 |
if isinstance(obj, objects.ConfigObject): |
96 |
# pylint: disable-msg=W0212
|
|
96 |
# pylint: disable=W0212 |
|
97 | 97 |
# yes, we're using a protected member |
98 | 98 |
for name in obj._all_slots(): |
99 | 99 |
child = getattr(obj, name, None) |
... | ... | |
156 | 156 |
arg = None |
157 | 157 |
try: |
158 | 158 |
self.cfg = config.ConfigWriter(cfg_file=arg, offline=True) |
159 |
self.parents = [self.cfg._config_data] # pylint: disable-msg=W0212
|
|
159 |
self.parents = [self.cfg._config_data] # pylint: disable=W0212 |
|
160 | 160 |
self.path = [] |
161 | 161 |
except errors.ConfigurationError, err: |
162 | 162 |
print "Error: %s" % str(err) |
... | ... | |
288 | 288 |
if self.cfg.VerifyConfig(): |
289 | 289 |
print "Config data does not validate, refusing to save." |
290 | 290 |
return False |
291 |
self.cfg._WriteConfig() # pylint: disable-msg=W0212
|
|
291 |
self.cfg._WriteConfig() # pylint: disable=W0212 |
|
292 | 292 |
|
293 | 293 |
def do_rm(self, line): |
294 | 294 |
"""Removes an instance or a node. |
... | ... | |
298 | 298 |
|
299 | 299 |
""" |
300 | 300 |
pointer = self.parents[-1] |
301 |
data = self.cfg._config_data # pylint: disable-msg=W0212
|
|
301 |
data = self.cfg._config_data # pylint: disable=W0212 |
|
302 | 302 |
if pointer not in (data.instances, data.nodes): |
303 | 303 |
print "Can only delete instances and nodes" |
304 | 304 |
return False |
Also available in: Unified diff