Revision 8a7f1c61 lib/cli.py
b/lib/cli.py | ||
---|---|---|
161 | 161 |
"GenerateTable", |
162 | 162 |
"AskUser", |
163 | 163 |
"FormatTimestamp", |
164 |
"FormatLogMessage", |
|
164 | 165 |
# Tags functions |
165 | 166 |
"ListTags", |
166 | 167 |
"AddTags", |
... | ... | |
1474 | 1475 |
|
1475 | 1476 |
""" |
1476 | 1477 |
ToStdout("%s %s", time.ctime(utils.MergeTime(timestamp)), |
1477 |
utils.SafeEncode(log_msg))
|
|
1478 |
FormatLogMessage(log_type, log_msg))
|
|
1478 | 1479 |
|
1479 | 1480 |
def ReportNotChanged(self, job_id, status): |
1480 | 1481 |
"""Called if a job hasn't changed in a while. |
... | ... | |
1492 | 1493 |
self.notified_waitlock = True |
1493 | 1494 |
|
1494 | 1495 |
|
1495 |
def PollJob(job_id, cl=None, feedback_fn=None): |
|
1496 |
def FormatLogMessage(log_type, log_msg): |
|
1497 |
"""Formats a job message according to its type. |
|
1498 |
|
|
1499 |
""" |
|
1500 |
if log_type != constants.ELOG_MESSAGE: |
|
1501 |
log_msg = str(log_msg) |
|
1502 |
|
|
1503 |
return utils.SafeEncode(log_msg) |
|
1504 |
|
|
1505 |
|
|
1496 | 1506 |
"""Function to poll for the result of a job. |
1497 | 1507 |
|
1498 | 1508 |
@type job_id: job identified |
Also available in: Unified diff