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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.toolbox
Commits
1bec3073
Commit
1bec3073
authored
Nov 30, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: user's git information can now contain utf-8 characters
parent
89ad1d9e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
slapos/runner/gittools.py
slapos/runner/gittools.py
+1
-1
slapos/runner/views.py
slapos/runner/views.py
+4
-3
No files found.
slapos/runner/gittools.py
View file @
1bec3073
...
@@ -39,7 +39,7 @@ def updateGitConfig(repository, user, email):
...
@@ -39,7 +39,7 @@ def updateGitConfig(repository, user, email):
repo
=
Repo
(
repository
)
repo
=
Repo
(
repository
)
config_writer
=
repo
.
config_writer
()
config_writer
=
repo
.
config_writer
()
if
user
!=
""
:
if
user
!=
""
:
config_writer
.
set_value
(
"user"
,
"name"
,
user
.
encode
(
"utf-8"
)
)
config_writer
.
set_value
(
"user"
,
"name"
,
user
)
if
email
!=
""
:
if
email
!=
""
:
config_writer
.
set_value
(
"user"
,
"email"
,
email
)
config_writer
.
set_value
(
"user"
,
"email"
,
email
)
config_writer
.
release
()
config_writer
.
release
()
...
...
slapos/runner/views.py
View file @
1bec3073
...
@@ -118,7 +118,7 @@ def manageRepository():
...
@@ -118,7 +118,7 @@ def manageRepository():
git_user_path
=
os
.
path
.
join
(
app
.
config
[
'etc_dir'
],
'.git_user'
)
git_user_path
=
os
.
path
.
join
(
app
.
config
[
'etc_dir'
],
'.git_user'
)
name
=
email
=
""
name
=
email
=
""
if
os
.
path
.
exists
(
git_user_path
):
if
os
.
path
.
exists
(
git_user_path
):
with
open
(
git_user_path
,
'r
'
)
as
gfile
:
with
codecs
.
open
(
git_user_path
,
'r'
,
encoding
=
'utf-8
'
)
as
gfile
:
name
,
email
=
gfile
.
read
().
split
(
';'
)
name
,
email
=
gfile
.
read
().
split
(
';'
)
return
render_template
(
'manageRepository.html'
,
workDir
=
'workspace'
,
return
render_template
(
'manageRepository.html'
,
workDir
=
'workspace'
,
project
=
listFolder
(
app
.
config
,
'workspace'
),
project
=
listFolder
(
app
.
config
,
'workspace'
),
...
@@ -633,8 +633,9 @@ def updateAccount():
...
@@ -633,8 +633,9 @@ def updateAccount():
updateGitConfig
(
app
.
config
[
'default_repository_path'
],
name
,
email
)
updateGitConfig
(
app
.
config
[
'default_repository_path'
],
name
,
email
)
except
GitCommandError
,
e
:
except
GitCommandError
,
e
:
return
jsonify
(
code
=
0
,
result
=
str
(
e
))
return
jsonify
(
code
=
0
,
result
=
str
(
e
))
with
open
(
os
.
path
.
join
(
app
.
config
[
'etc_dir'
],
'.git_user'
),
'w'
)
as
gfile
:
git_user_file
=
os
.
path
.
join
(
app
.
config
[
'etc_dir'
],
'.git_user'
)
gfile
.
write
(
'%s;%s'
%
(
name
,
email
))
with
codecs
.
open
(
git_user_file
,
'w'
,
encoding
=
'utf-8'
)
as
gfile
:
gfile
.
write
(
u'{};{}'
.
format
(
name
,
email
))
return
jsonify
(
code
=
1
,
result
=
""
)
return
jsonify
(
code
=
1
,
result
=
""
)
...
...
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