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
87fc2ea1
Commit
87fc2ea1
authored
Jun 16, 2021
by
hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix private method
parent
dda388e6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
ci-scripts/cls_log_mgt.py
ci-scripts/cls_log_mgt.py
+7
-5
No files found.
ci-scripts/cls_log_mgt.py
View file @
87fc2ea1
...
@@ -66,11 +66,8 @@ class Log_Mgt:
...
@@ -66,11 +66,8 @@ class Log_Mgt:
tmp
=
s
.
split
()
tmp
=
s
.
split
()
return
tmp
[
8
]
#return filename from the line
return
tmp
[
8
]
#return filename from the line
#-----------------$
#PUBLIC Methods$
#-----------------$
def
AvgSize
(
self
):
def
__
AvgSize
(
self
):
HOST
=
self
.
IPAddress
HOST
=
self
.
IPAddress
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
)
...
@@ -83,9 +80,14 @@ class Log_Mgt:
...
@@ -83,9 +80,14 @@ class Log_Mgt:
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
#-----------------$
#PUBLIC Methods$
#-----------------$
def
LogRotation
(
self
):
def
LogRotation
(
self
):
avail_space
=
int
(
self
.
__CheckAvailSpace
())
*
1000
#avail space in target folder, initially displayed in Gb
avail_space
=
int
(
self
.
__CheckAvailSpace
())
*
1000
#avail space in target folder, initially displayed in Gb
avg_size
=
self
.
AvgSize
()
#average size of artifacts in the target folder
avg_size
=
self
.
__
AvgSize
()
#average size of artifacts in the target folder
logging
.
debug
(
"Avail Space : "
+
str
(
avail_space
)
+
" / Artifact Avg Size : "
+
str
(
avg_size
))
logging
.
debug
(
"Avail Space : "
+
str
(
avail_space
)
+
" / Artifact Avg Size : "
+
str
(
avg_size
))
if
avail_space
<
2
*
avg_size
:
#reserved space is 2x artifact file ; oldest file will be deleted
if
avail_space
<
2
*
avg_size
:
#reserved space is 2x artifact file ; oldest file will be deleted
oldestfile
=
self
.
__GetOldestFile
()
oldestfile
=
self
.
__GetOldestFile
()
...
...
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