From 72ae7f9cb6de4aa8b0eb320e918fdf8de1908b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Ninivin?= Date: Thu, 27 Jun 2013 19:12:10 +0200 Subject: [PATCH] slaprunner: check htpasswd file exists before removal --- slapos/runner/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slapos/runner/utils.py b/slapos/runner/utils.py index dad126f..7fa7768 100755 --- a/slapos/runner/utils.py +++ b/slapos/runner/utils.py @@ -84,7 +84,8 @@ def saveSession(config, account): # Htpasswd file for cloud9 # XXX Cedric Le N order of account list values suppose to be fixed # Remove former file to avoid aoutdated accounts - os.remove(htpasswdfile) + if os.path.exists(htpasswdfile): + os.remove(htpasswdfile) passwd = HtpasswdFile(htpasswdfile, create=True) passwd.update(account[0], account[1]) passwd.save() -- 2.25.1