From a5a3eb6d7bd3254c34b17afd251a1460e9061d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Wed, 29 Mar 2017 17:37:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B2=D1=85=D0=BE=D0=B4=20=D0=B2=20=D1=81=D0=B5?= =?UTF-8?q?=D0=B0=D0=BD=D1=81=20=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D0=BC=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D0=B5=D0=BC=20=D1=81=20=D0=B8=D1=81=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC=20?= =?UTF-8?q?=D1=88=D0=B8=D1=84=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/desktop/desktop.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pym/desktop/desktop.py b/pym/desktop/desktop.py index 9f8cf4f..e127e4e 100644 --- a/pym/desktop/desktop.py +++ b/pym/desktop/desktop.py @@ -110,6 +110,7 @@ class Desktop(MethodsInterface): # если нет шифрованных данных if not path.exists(ecryptfsPath): tf = None + remove_files = None try: # если профиль содержит только данные от бутстрапа core if isBootstrapDataOnly(userDir): @@ -142,7 +143,7 @@ class Desktop(MethodsInterface): if e.failed(): raise DesktopError(e.read()) # если были данные от бутстрапа, то распаковать их - if tf: + if tf and remove_files: with tarfile.open(fileobj=tf, mode='r:') as tarf: tarf.extractall(userDir) except Exception as e: @@ -153,9 +154,10 @@ class Desktop(MethodsInterface): bakArchName = path.join(userDir, ".calculate.tar.bz2") with open(bakArchName, 'w') as f: f.write(tf.read()) - raise DesktopError(str(e) + - _( - "Failed to create an encrypted user profile")) + raise DesktopError( + "%s\n%s" % + (str(e), + _("Failed to create an encrypted user profile"))) finally: if tf: tf.close()