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
f994c4d1
Commit
f994c4d1
authored
May 10, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(connect.py) 修复max引起的异常
已经修复
parent
5fab276c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
connect.py
connect.py
+3
-0
No files found.
connect.py
View file @
f994c4d1
...
@@ -518,7 +518,10 @@ class Nav(object):
...
@@ -518,7 +518,10 @@ class Nav(object):
@staticmethod
@staticmethod
def
get_max_asset_property_length
(
assets
,
property_
=
'hostname'
):
def
get_max_asset_property_length
(
assets
,
property_
=
'hostname'
):
try
:
return
max
([
len
(
getattr
(
asset
,
property_
))
for
asset
in
assets
])
return
max
([
len
(
getattr
(
asset
,
property_
))
for
asset
in
assets
])
except
ValueError
:
return
30
def
print_search_result
(
self
):
def
print_search_result
(
self
):
hostname_max_length
=
self
.
get_max_asset_property_length
(
self
.
search_result
)
hostname_max_length
=
self
.
get_max_asset_property_length
(
self
.
search_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