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():
|
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():
|
|||||||
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():
|
|||||||
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():
|
|||||||
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:
|
||||||
|
|||||||
Reference in New Issue
Block a user