adding new class for log mgt/rotation on remote servers

This commit is contained in:
Remi Hardy
2021-06-17 09:58:15 +02:00
committed by hardy
parent 5ef64f467a
commit 8371109a93
2 changed files with 111 additions and 0 deletions
+8
View File
@@ -39,6 +39,9 @@ import subprocess
from datetime import datetime
#for log rotation mgt
import cls_log_mgt
class Module_UE:
def __init__(self,Module):
@@ -157,6 +160,11 @@ class Module_UE:
now_string = now.strftime("%Y%m%d-%H%M")
source='ci_qlog'
destination='/opt/ci_qlogs/ci_qlog_'+now_string+'.zip'
#qlog artifact is zipped into the target folder
mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S zip -r '+destination+' '+source+' &','\$', 10)
mySSH.close()
#post action : log cleaning to make sure enough space is reserved for the next run
Log_Mgt=cls_log_mgt.Log_Mgt(self.HostIPAddress, self.HostPassword, "/opt/ci_qlogs")
Log_Mgt.LogRotation()
return destination