Created
August 21, 2010 17:45
-
-
Save littleidea/542620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_error_log(prefix): | |
def error_log(msg_or_exc): | |
global unmounted | |
if hasattr(msg_or_exc, 'http_status') and \ | |
msg_or_exc.http_status == 507: | |
identifier = '%s:%s/%s' | |
if identifier not in unmounted: | |
unmounted.append(identifier) | |
print >>stderr, 'ERROR: %s:%s/%s is unmounted -- This will ' \ | |
'cause replicas designated for that device to be ' \ | |
'considered missing until resolved or the ring is ' \ | |
'updated.' % (msg_or_exc.http_host, msg_or_exc.http_port, | |
msg_or_exc.http_device) | |
if not hasattr(msg_or_exc, 'http_status') or \ | |
msg_or_exc.http_status not in (404, 507): | |
print >>stderr, 'ERROR: %s: %s' % (prefix, msg_or_exc) | |
return error_log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment