Merge branch 'serge'

This commit is contained in:
Roman Zeyde
2018-02-24 21:07:42 +02:00
2 changed files with 22 additions and 5 deletions

View File

@@ -126,7 +126,11 @@ def run_init(device_type, args):
homedir = os.path.expanduser('~/.gnupg/{}'.format(device_name))
log.info('GPG home directory: %s', homedir)
check_call(['rm', '-rf', homedir])
if os.path.exists(homedir):
log.error('GPG home directory %s exists, '
'remove it manually if required', homedir)
sys.exit(1)
check_call(['mkdir', '-p', homedir])
check_call(['chmod', '700', homedir])