Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
f24b3475
Commit
f24b3475
authored
Feb 23, 2016
by
yumaojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复sudo 命令 小写all 引起的推送失败
parent
d4b1bdef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
views.py
jperm/views.py
+12
-2
No files found.
jperm/views.py
View file @
f24b3475
...
...
@@ -619,7 +619,12 @@ def perm_sudo_add(request):
raise
ServerError
(
u"sudo name 和 commands是必填项!"
)
pattern
=
re
.
compile
(
r'[\n,\r]'
)
commands
=
', '
.
join
(
list_drop_str
(
pattern
.
split
(
commands
),
u''
))
deal_commands
=
list_drop_str
(
pattern
.
split
(
commands
),
u''
)
for
command
in
deal_commands
:
if
command
.
lower
()
==
"all"
:
deal_commands
.
remove
(
command
)
deal_commands
.
append
(
command
.
upper
())
commands
=
', '
.
join
(
deal_commands
)
logger
.
debug
(
u'添加sudo
%
s:
%
s'
%
(
name
,
commands
))
if
get_object
(
PermSudo
,
name
=
name
):
...
...
@@ -656,7 +661,12 @@ def perm_sudo_edit(request):
raise
ServerError
(
u"sudo name 和 commands是必填项!"
)
pattern
=
re
.
compile
(
r'[\n,\r]'
)
commands
=
', '
.
join
(
list_drop_str
(
pattern
.
split
(
commands
),
u''
))
.
strip
()
deal_commands
=
list_drop_str
(
pattern
.
split
(
commands
),
u''
)
for
command
in
deal_commands
:
if
command
.
lower
()
==
"all"
:
deal_commands
.
remove
(
command
)
deal_commands
.
append
(
command
.
upper
())
commands
=
', '
.
join
(
deal_commands
)
.
strip
()
logger
.
debug
(
u'添加sudo
%
s:
%
s'
%
(
name
,
commands
))
sudo
.
name
=
name
.
strip
()
...
...
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