Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
c54c9fdc
Commit
c54c9fdc
authored
May 16, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generatepassword recipe: added missing O_TRUNC
parent
3365305c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
slapos/recipe/generatepassword.py
slapos/recipe/generatepassword.py
+3
-3
No files found.
slapos/recipe/generatepassword.py
View file @
c54c9fdc
...
...
@@ -60,7 +60,7 @@ class Recipe(object):
try
:
with
open
(
self
.
storage_path
)
as
f
:
passwd
=
f
.
read
()
except
IOError
,
e
:
except
IOError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
passwd
=
None
...
...
@@ -79,11 +79,11 @@ class Recipe(object):
if
self
.
storage_path
:
try
:
os
.
unlink
(
self
.
storage_path
)
except
OSError
,
e
:
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
fd
=
os
.
open
(
self
.
storage_path
,
os
.
O_CREAT
|
os
.
O_EXCL
|
os
.
O_WRONLY
,
0600
)
os
.
O_CREAT
|
os
.
O_EXCL
|
os
.
O_WRONLY
|
os
.
O_TRUNC
,
0600
)
try
:
os
.
write
(
fd
,
self
.
passwd
)
finally
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment