~mterry/duplicity/consolidate-tests

« back to all changes in this revision

Viewing changes to bin/duplicity

  • Committer: Kenneth Loafman
  • Date: 2014-01-21 19:42:16 UTC
  • mfrom: (954.1.1 duplicity)
  • Revision ID: kenneth@loafman.com-20140121194216-qs9hav8571o4z70c
* Merged in lp:~louis-bouchard/duplicity/remove-allow-concurrency
  - remove the --allow-concurrency switch but leave the lock

Show diffs side-by-side

added added

removed removed

Lines of Context:
1316
1316
    # determine what action we're performing and process command line
1317
1317
    action = commandline.ProcessCommandLine(sys.argv[1:])
1318
1318
 
1319
 
    globals.lockfile = None
1320
 
 
1321
 
    if not globals.allow_concurrency:
1322
 
        globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"))
1323
 
        if globals.lockfile.is_locked():
1324
 
            log.FatalError("Another instance is already running with this archive directory", log.ErrorCode.user_error)
1325
 
            log.shutdown()
1326
 
            sys.exit(2)
 
1319
    globals.lockfile = FileLock(os.path.join(globals.archive_dir.name, "lockfile"))
 
1320
    if globals.lockfile.is_locked():
 
1321
        log.FatalError("Another instance is already running with this archive directory\n"
 
1322
                       "If you are sure that this is the  only instance running you may delete\n"
 
1323
                       "the following lockfile and run the command again :\n"
 
1324
                       "\t%s" % os.path.join(globals.archive_dir.name, "lockfile.lock" )
 
1325
                       , log.ErrorCode.user_error)
 
1326
        log.shutdown()
 
1327
        sys.exit(2)
1327
1328
            
1328
 
        globals.lockfile.acquire(timeout = 0)
 
1329
    globals.lockfile.acquire(timeout = 0)
1329
1330
 
1330
1331
    try:
1331
1332
        do_backup(action)