Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
slapos-mynij-dev
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
Show 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):
...
@@ -60,7 +60,7 @@ class Recipe(object):
try
:
try
:
with
open
(
self
.
storage_path
)
as
f
:
with
open
(
self
.
storage_path
)
as
f
:
passwd
=
f
.
read
()
passwd
=
f
.
read
()
except
IOError
,
e
:
except
IOError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
raise
passwd
=
None
passwd
=
None
...
@@ -79,11 +79,11 @@ class Recipe(object):
...
@@ -79,11 +79,11 @@ class Recipe(object):
if
self
.
storage_path
:
if
self
.
storage_path
:
try
:
try
:
os
.
unlink
(
self
.
storage_path
)
os
.
unlink
(
self
.
storage_path
)
except
OSError
,
e
:
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
raise
fd
=
os
.
open
(
self
.
storage_path
,
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
:
try
:
os
.
write
(
fd
,
self
.
passwd
)
os
.
write
(
fd
,
self
.
passwd
)
finally
:
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