Changeset 5876

Show
Ignore:
Timestamp:
03/10/11 11:35:52 (2 years ago)
Author:
luis
Message:

Fixing #380: conflits with umitweb in Windows

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • network-scanner/trunk/umit/merger/nt_appdata.py

    r5632 r5876  
    4949 
    5050        backup_path = old_path + '_backup' 
    51         if os.path.exists(old_path): 
     51        if os.path.exists(old_path) and \ 
     52           not os.path.exists(os.path.join(old_path, "MERGED")) \ 
     53           and not os.path.exists(backup_path) : 
    5254            # Move the old ~/.umit to ~/.umit_backup so next time this 
    5355            # merger runs it will notice the absence of ~/.umit 
    54             shutil.move(old_path, backup_path) 
     56            # If UmitWeb is an old version, it will keep ~/.umit alive  
     57            if os.path.exists(os.path.join(old_path, "umitweb.log")): 
     58                shutil.copytree(old_path, backup_path) 
     59                # Create a file to tag that was already merged 
     60                file = open(os.path.join(old_path, "MERGED"), 'w') 
     61                file.write('') 
     62                file.close() 
     63            else: 
     64                shutil.move(old_path, backup_path) 
    5565 
    5666            new_path = os.path.join(BasePaths.HOME, BasePaths.UMIT_CFG_DIR)