/usr/lib/python2.7/dist-packages/deployer/feedback.py is in juju-deployer 0.6.4-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | WARN = 3
ERROR = 7
class Feedback(object):
def __init__(self):
self.messages = []
self.has_errors = False
def error(self, msg):
self.messages.append((ERROR, msg))
self.has_errors = True
def warn(self, msg):
self.messages.append((WARN, msg))
def __iter__(self):
return iter(self.messages)
def __nonzero__(self):
return bool(self.messages)
def get_errors(self):
return [m for (m_kind, m) in self.messages if m_kind == ERROR]
def get_warnings(self):
return [m for (m_kind, m) in self.messages if m_kind == WARN]
def extend(self, other):
self.messages.extend(other.messages)
if not self.has_errors and other.has_errors:
self.has_errors = True
|