comparison rhodecode/lib/db_manage.py @ 2165:dc2584ba5fbc

merged beta into default branch
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 28 Mar 2012 19:54:16 +0200
parents 82a88013a3fd 1477e048292e
children 533a126dc9ab
comparison
equal deleted inserted replaced
2097:8fd6650bb436 2165:dc2584ba5fbc
374 if retries == 3: 374 if retries == 3:
375 log.info('Setting up repositories config') 375 log.info('Setting up repositories config')
376 376
377 if not self.tests and not test_repo_path: 377 if not self.tests and not test_repo_path:
378 path = raw_input( 378 path = raw_input(
379 'Enter a valid path to store repositories. ' 379 'Enter a valid absolute path to store repositories. '
380 'All repositories in that path will be added automatically:' 380 'All repositories in that path will be added automatically:'
381 ) 381 )
382 else: 382 else:
383 path = test_repo_path 383 path = test_repo_path
384 path_ok = True 384 path_ok = True
386 # check proper dir 386 # check proper dir
387 if not os.path.isdir(path): 387 if not os.path.isdir(path):
388 path_ok = False 388 path_ok = False
389 log.error('Given path %s is not a valid directory' % path) 389 log.error('Given path %s is not a valid directory' % path)
390 390
391 elif not os.path.isabs(path):
392 path_ok = False
393 log.error('Given path %s is not an absolute path' % path)
394
391 # check write access 395 # check write access
392 if not os.access(path, os.W_OK) and path_ok: 396 elif not os.access(path, os.W_OK) and path_ok:
393 path_ok = False 397 path_ok = False
394 log.error('No write permission to given path %s' % path) 398 log.error('No write permission to given path %s' % path)
395 399
396 if retries == 0: 400 if retries == 0:
397 sys.exit('max retries reached') 401 sys.exit('max retries reached')