Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
wangjie
OpenXG-RAN
Commits
515a30a6
Commit
515a30a6
authored
Jul 26, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix avg file size computation when folder is empty
parent
e241fb50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
ci-scripts/cls_log_mgt.py
ci-scripts/cls_log_mgt.py
+9
-6
No files found.
ci-scripts/cls_log_mgt.py
View file @
515a30a6
...
@@ -72,12 +72,15 @@ class Log_Mgt:
...
@@ -72,12 +72,15 @@ class Log_Mgt:
COMMAND
=
"ls -rtl "
+
self
.
path
COMMAND
=
"ls -rtl "
+
self
.
path
ssh
=
subprocess
.
Popen
([
"ssh"
,
"%s"
%
HOST
,
COMMAND
],
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
ssh
=
subprocess
.
Popen
([
"ssh"
,
"%s"
%
HOST
,
COMMAND
],
shell
=
False
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
result
=
ssh
.
stdout
.
readlines
()
result
=
ssh
.
stdout
.
readlines
()
if
len
(
result
)
>
1
:
#at least 1 file present
total_size
=
0
total_size
=
0
for
i
in
range
(
1
,
len
(
result
)):
for
i
in
range
(
1
,
len
(
result
)):
s
=
result
[
i
].
decode
(
'utf-8'
).
rstrip
()
s
=
result
[
i
].
decode
(
'utf-8'
).
rstrip
()
tmp
=
s
.
split
()
tmp
=
s
.
split
()
total_size
+=
int
(
tmp
[
4
])
#get filesize
total_size
+=
int
(
tmp
[
4
])
#get filesize
return
math
.
floor
(
total_size
/
(
len
(
result
)
-
1
))
#compute average file/artifact size
return
math
.
floor
(
total_size
/
(
len
(
result
)
-
1
))
#compute average file/artifact size
else
:
#empty,no files
return
0
#-----------------$
#-----------------$
...
...
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