Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.toolbox
Commits
ff93f75e
Commit
ff93f75e
authored
Jun 25, 2012
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing changes in user sessions management
parent
1e9dd387
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
slapos/runner/utils.py
slapos/runner/utils.py
+5
-2
No files found.
slapos/runner/utils.py
View file @
ff93f75e
...
...
@@ -64,6 +64,7 @@ def getSession(config):
def
saveSession
(
config
,
session
,
account
):
user
=
os
.
path
.
join
(
config
[
'runner_workdir'
],
'.users'
)
backup
=
False
try
:
if
account
[
1
]:
salt
=
"runner81"
#to be changed
...
...
@@ -72,14 +73,16 @@ def saveSession(config, session, account):
account
[
1
]
=
session
[
'account'
][
1
]
#backup previous data
open
(
user
+
'.back'
,
'w'
).
write
(
';'
.
join
(
session
[
'account'
]))
backup
=
True
#save new account data
open
(
user
,
'w'
).
write
((
';'
.
join
(
account
)).
encode
(
"utf-8"
))
session
[
'account'
]
=
account
return
True
except
Exception
,
e
:
try
:
os
.
remove
(
user
)
os
.
rename
(
user
+
'.back'
,
user
)
if
backup
:
os
.
remove
(
user
)
os
.
rename
(
user
+
'.back'
,
user
)
except
:
pass
return
str
(
e
)
...
...
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