Revision 71eca7c3 lib/backend.py

b/lib/backend.py
129 129
  """Cleans up the current node and prepares it to be removed from the cluster.
130 130

  
131 131
  """
132
  if os.path.exists(constants.DATA_DIR):
133
    for dirpath, dirnames, filenames in os.walk(constants.DATA_DIR):
134
      if dirpath == constants.DATA_DIR:
135
        for i in filenames:
136
          os.unlink(os.path.join(dirpath, i))
132
  if os.path.isdir(constants.DATA_DIR):
133
    for rel_name in utils.ListVisibleFiles(constants.DATA_DIR):
134
      full_name = os.path.join(constants.DATA_DIR, rel_name)
135
      if os.path.isfile(full_name) and not os.path.islink(full_name):
136
        utils.RemoveFile(full_name)
137 137

  
138 138
  f = open('/root/.ssh/id_dsa.pub', 'r')
139 139
  try:

Also available in: Unified diff