1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-06 05:08:42 +02:00

chmod handling

* prefer os.open instead of open && os.chmod
 * prefer os.fchmod when fd exists
This commit is contained in:
Michal Vyskocil
2014-01-06 11:12:02 +01:00
parent 550039f746
commit 5d5185cbc6
2 changed files with 3 additions and 3 deletions

View File

@@ -570,8 +570,8 @@ def init_basicauth(config):
cookiejar.load(ignore_discard=True)
except IOError:
try:
open(cookie_file, 'w').close()
os.chmod(cookie_file, 0o600)
fd = os.open(cookie_file, os.O_CREAT | os.O_WRONLY | os.O_TRUNC, mode=0o600)
os.close(fd)
except:
#print 'Unable to create cookiejar file: \'%s\'. Using RAM-based cookies.' % cookie_file
cookiejar = CookieJar()