adding new class for log mgt/rotation on remote servers
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user