Commit 4bf6ce32 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(ci): when running the bare-metal pipelines, some files are already on the...

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: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent f3594a66
...@@ -743,7 +743,7 @@ class RANManagement(): ...@@ -743,7 +743,7 @@ class RANManagement():
for x in os.listdir(): for x in os.listdir():
if x.endswith('.log') or x.endswith('.log.png'): 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 # Back to normal
mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword) mySSH.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
mySSH.command('cd ' + self.eNBSourceCodePath, '\$', 5) mySSH.command('cd ' + self.eNBSourceCodePath, '\$', 5)
......
...@@ -229,7 +229,7 @@ class SSHConnection(): ...@@ -229,7 +229,7 @@ class SSHConnection():
else: else:
return -1 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 count = 0
copy_status = False copy_status = False
if not silent: if not silent:
...@@ -245,6 +245,10 @@ class SSHConnection(): ...@@ -245,6 +245,10 @@ class SSHConnection():
if scp_response == 0: if scp_response == 0:
count = 10 count = 10
copy_status = True copy_status = True
elif scp_response == 1 and ignorePermDenied:
logging.warning('Copy was denied but ignored!')
count = 10
copy_status = True
else: else:
logging.warning('1 - scp_response = ' + str(scp_response)) logging.warning('1 - scp_response = ' + str(scp_response))
elif scp_response == 1: elif scp_response == 1:
...@@ -253,6 +257,10 @@ class SSHConnection(): ...@@ -253,6 +257,10 @@ class SSHConnection():
if scp_response == 0 or scp_response == 3: if scp_response == 0 or scp_response == 3:
count = 10 count = 10
copy_status = True copy_status = True
elif scp_response == 1 and ignorePermDenied:
logging.warning('Copy was denied but ignored!')
count = 10
copy_status = True
else: else:
logging.warning('2 - scp_response = ' + str(scp_response)) logging.warning('2 - scp_response = ' + str(scp_response))
elif scp_response == 2: elif scp_response == 2:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment