Revision 0fbbf897 lib/mcpu.py
b/lib/mcpu.py | ||
---|---|---|
36 | 36 |
from ganeti import cmdlib |
37 | 37 |
from ganeti import config |
38 | 38 |
from ganeti import ssconf |
39 |
from ganeti import logger |
|
39 | 40 |
|
40 | 41 |
class Processor(object): |
41 | 42 |
"""Object which runs OpCodes""" |
... | ... | |
165 | 166 |
# hm.RunPhase(constants.HOOKS_PHASE_POST) |
166 | 167 |
return result |
167 | 168 |
|
169 |
def LogStep(self, current, total, message): |
|
170 |
"""Log a change in LU execution progress. |
|
171 |
|
|
172 |
""" |
|
173 |
logger.Debug("Step %d/%d %s" % (current, total, message)) |
|
174 |
self._feedback_fn("STEP %d/%d %s" % (current, total, message)) |
|
175 |
|
|
176 |
def LogWarning(self, message, hint): |
|
177 |
"""Log a warning to the logs and the user. |
|
178 |
|
|
179 |
""" |
|
180 |
logger.Error(message) |
|
181 |
self._feedback_fn(" - WARNING: %s" % message) |
|
182 |
self._feedback_fn(" Hint: %s" % hint) |
|
183 |
|
|
184 |
def LogInfo(self, message): |
|
185 |
"""Log an informational message to the logs and the user. |
|
186 |
|
|
187 |
""" |
|
188 |
logger.Info(message) |
|
189 |
self._feedback_fn(" - INFO: %s" % message) |
|
190 |
|
|
168 | 191 |
|
169 | 192 |
class HooksMaster(object): |
170 | 193 |
"""Hooks master. |
Also available in: Unified diff