Revision 099c52ad lib/utils.py

b/lib/utils.py
42 42
import resource
43 43
import logging
44 44
import signal
45
import string
46 45

  
47 46
from cStringIO import StringIO
48 47

  
......
519 518
  re_flags = 0
520 519
  if not case_sensitive:
521 520
    re_flags |= re.IGNORECASE
522
    key = string.upper(key)
521
    key = key.upper()
523 522
  mo = re.compile("^%s(\..*)?$" % re.escape(key), re_flags)
524 523
  names_filtered = []
525 524
  string_matches = []
526 525
  for name in name_list:
527 526
    if mo.match(name) is not None:
528 527
      names_filtered.append(name)
529
      if not case_sensitive and key == string.upper(name):
528
      if not case_sensitive and key == name.upper():
530 529
        string_matches.append(name)
531 530

  
532 531
  if len(string_matches) == 1:
......
1107 1106
    success = True
1108 1107
  except socket.timeout:
1109 1108
    success = False
1110
  except socket.error, (errcode, errstring):
1109
  except socket.error, (errcode, _):
1111 1110
    success = (not live_port_needed) and (errcode == errno.ECONNREFUSED)
1112 1111

  
1113 1112
  return success

Also available in: Unified diff