fix(ci): when running the bare-metal pipelines, some files are already on the target side with root ownership. Copy is bypassed
Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
+1
-1
@@ -743,7 +743,7 @@ class RANManagement():
|
||||
|
||||
for x in os.listdir():
|
||||
if x.endswith('.log') or x.endswith('.log.png'):
|
||||
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, x, self.eNBSourceCodePath + '/cmake_targets/', silent=True)
|
||||
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, x, self.eNBSourceCodePath + '/cmake_targets/', silent=True, ignorePermDenied=True)
|
||||
# Back to normal
|
||||
mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
|
||||
mySSH.command('cd ' + self.eNBSourceCodePath, '\$', 5)
|
||||
|
||||
@@ -229,7 +229,7 @@ class SSHConnection():
|
||||
else:
|
||||
return -1
|
||||
|
||||
def copyout(self, ipaddress, username, password, source, destination, silent=False):
|
||||
def copyout(self, ipaddress, username, password, source, destination, silent=False, ignorePermDenied=False):
|
||||
count = 0
|
||||
copy_status = False
|
||||
if not silent:
|
||||
@@ -245,6 +245,10 @@ class SSHConnection():
|
||||
if scp_response == 0:
|
||||
count = 10
|
||||
copy_status = True
|
||||
elif scp_response == 1 and ignorePermDenied:
|
||||
logging.warning('Copy was denied but ignored!')
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.warning('1 - scp_response = ' + str(scp_response))
|
||||
elif scp_response == 1:
|
||||
@@ -253,6 +257,10 @@ class SSHConnection():
|
||||
if scp_response == 0 or scp_response == 3:
|
||||
count = 10
|
||||
copy_status = True
|
||||
elif scp_response == 1 and ignorePermDenied:
|
||||
logging.warning('Copy was denied but ignored!')
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.warning('2 - scp_response = ' + str(scp_response))
|
||||
elif scp_response == 2:
|
||||
|
||||
Reference in New Issue
Block a user