Revision 65fe4693

b/lib/backend.py
942 942
  if search_path is None:
943 943
    search_path = constants.OS_SEARCH_PATH
944 944

  
945
  for dir in search_path:
946
    t_os_dir = os.path.sep.join([dir, name])
945
  for dir_name in search_path:
946
    t_os_dir = os.path.sep.join([dir_name, name])
947 947
    if os.path.isdir(t_os_dir):
948
        return dir
948
      return dir_name
949 949

  
950 950
  return None
951 951

  
......
1006 1006
    top_dirs = constants.OS_SEARCH_PATH
1007 1007

  
1008 1008
  result = []
1009
  for dir in top_dirs:
1010
    if os.path.isdir(dir):
1009
  for dir_name in top_dirs:
1010
    if os.path.isdir(dir_name):
1011 1011
      try:
1012
        f_names = utils.ListVisibleFiles(dir)
1012
        f_names = utils.ListVisibleFiles(dir_name)
1013 1013
      except EnvironmentError, err:
1014
        logger.Error("Can't list the OS directory %s: %s" % (dir,str(err)))
1014
        logger.Error("Can't list the OS directory %s: %s" %
1015
                     (dir_name, str(err)))
1015 1016
        break
1016 1017
      for name in f_names:
1017 1018
        try:
1018
          os_inst = OSFromDisk(name, base_dir=dir)
1019
          os_inst = OSFromDisk(name, base_dir=dir_name)
1019 1020
          result.append(os_inst)
1020 1021
        except errors.InvalidOS, err:
1021 1022
          result.append(objects.OS.FromInvalidOS(err))
b/lib/bdev.py
2146 2146
    self.unique_id = new_uid
2147 2147
    if not self._AssembleNet(self.minor, self.unique_id, "C"):
2148 2148
      logger.Error("Can't attach to new peer!")
2149
      if self.old_id is not None:
2149
      if old_id is not None:
2150 2150
        self._AssembleNet(self.minor, old_id, "C")
2151 2151
      self.unique_id = old_id
2152 2152
      raise errors.BlockDeviceError("Can't attach to new peer")
b/lib/cli.py
195 195

  
196 196

  
197 197
def check_unit(option, opt, value):
198
  """OptParsers custom converter for units.
199

  
200
  """
198 201
  try:
199 202
    return utils.ParseUnit(value)
200 203
  except errors.UnitParseError, err:
......
202 205

  
203 206

  
204 207
class CliOption(Option):
208
  """Custom option class for optparse.
209

  
210
  """
205 211
  TYPES = Option.TYPES + ("unit",)
206 212
  TYPE_CHECKER = copy.copy(Option.TYPE_CHECKER)
207 213
  TYPE_CHECKER["unit"] = check_unit
b/lib/cmdlib.py
26 26
import os
27 27
import os.path
28 28
import sha
29
import socket
30 29
import time
31 30
import tempfile
32 31
import re
......
856 855
    feedback_fn("* Verifying global settings")
857 856
    self.cfg.VerifyConfig()
858 857

  
859
    master = self.sstore.GetMasterNode()
860 858
    vg_name = self.cfg.GetVGName()
861 859
    nodelist = utils.NiceSort(self.cfg.GetNodeList())
862 860
    instancelist = utils.NiceSort(self.cfg.GetInstanceList())
b/lib/utils.py
752 752
                                file_name)
753 753

  
754 754
  prefix = '%s.backup-%d.' % (os.path.basename(file_name), int(time.time()))
755
  dir = os.path.dirname(file_name)
755
  dir_name = os.path.dirname(file_name)
756 756

  
757 757
  fsrc = open(file_name, 'rb')
758 758
  try:
759
    (fd, backup_name) = tempfile.mkstemp(prefix=prefix, dir=dir)
759
    (fd, backup_name) = tempfile.mkstemp(prefix=prefix, dir=dir_name)
760 760
    fdst = os.fdopen(fd, 'wb')
761 761
    try:
762 762
      shutil.copyfileobj(fsrc, fdst)

Also available in: Unified diff