gpg: use 'sys.exit' and log homedir

This commit is contained in:
Roman Zeyde
2018-02-24 20:46:04 +02:00
parent 6363eb0d4a
commit 199fb299c3

View File

@@ -127,8 +127,9 @@ def run_init(device_type, args):
log.info('GPG home directory: %s', homedir) log.info('GPG home directory: %s', homedir)
if os.path.exists(homedir): if os.path.exists(homedir):
log.error('GPG home directory exists, remove it manually if required') log.error('GPG home directory %s exists, '
exit(1) 'remove it manually if required', homedir)
sys.exit(1)
check_call(['mkdir', '-p', homedir]) check_call(['mkdir', '-p', homedir])
check_call(['chmod', '700', homedir]) check_call(['chmod', '700', homedir])