Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
c1b448cd
Commit
c1b448cd
authored
Aug 19, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle errors in Copy_Image_to_Test_Server()
parent
3a0a14cf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
ci-scripts/cls_containerize.py
ci-scripts/cls_containerize.py
+20
-1
ci-scripts/main.py
ci-scripts/main.py
+3
-1
No files found.
ci-scripts/cls_containerize.py
View file @
c1b448cd
...
...
@@ -580,8 +580,16 @@ class Containerize():
lPassWord
=
self
.
eNB2Password
lSsh
.
open
(
lIpAddr
,
lUserName
,
lPassWord
)
lSsh
.
command
(
'docker save '
+
self
.
imageToCopy
+
':'
+
imageTag
+
' | gzip --fast > '
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
,
'\$'
,
60
)
lSsh
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
'~/'
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
,
'.'
)
ret
=
lSsh
.
copyin
(
lIpAddr
,
lUserName
,
lPassWord
,
'~/'
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
,
'.'
)
if
ret
!=
0
:
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
exitStatus
=
1
return
False
lSsh
.
command
(
'rm '
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
,
'\$'
,
60
)
if
lSsh
.
getBefore
().
count
(
'cannot remove'
):
HTML
.
CreateHtmlTestRow
(
'file not created by docker save'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
exitStatus
=
1
return
False
lSsh
.
close
()
# Going to the Test Server
...
...
@@ -599,15 +607,26 @@ class Containerize():
lPassWord
=
self
.
eNB2Password
lSsh
.
open
(
lIpAddr
,
lUserName
,
lPassWord
)
lSsh
.
copyout
(
lIpAddr
,
lUserName
,
lPassWord
,
'./'
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
,
'~'
)
# copyout has no return code and will quit if something fails
lSsh
.
command
(
'docker rmi '
+
self
.
imageToCopy
+
':'
+
imageTag
,
'\$'
,
10
)
lSsh
.
command
(
'docker load < '
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
,
'\$'
,
60
)
if
lSsh
.
getBefore
().
count
(
'o such file'
)
or
lSsh
.
getBefore
().
count
(
'invalid tar header'
):
logging
.
debug
(
lSsh
.
getBefore
())
HTML
.
CreateHtmlTestRow
(
'problem during docker load'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
exitStatus
=
1
return
False
lSsh
.
command
(
'rm '
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
,
'\$'
,
60
)
if
lSsh
.
getBefore
().
count
(
'cannot remove'
):
HTML
.
CreateHtmlTestRow
(
'file not copied during scp?'
,
'KO'
,
CONST
.
ALL_PROCESSES_OK
)
self
.
exitStatus
=
1
return
False
lSsh
.
close
()
if
os
.
path
.
isfile
(
'./'
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
):
os
.
remove
(
'./'
+
self
.
imageToCopy
+
'-'
+
imageTag
+
'.tar.gz'
)
HTML
.
CreateHtmlTestRow
(
'N/A'
,
'OK'
,
CONST
.
ALL_PROCESSES_OK
)
return
True
def
DeployObject
(
self
,
HTML
,
EPC
):
if
self
.
eNB_serverId
[
self
.
eNB_instance
]
==
'0'
:
...
...
ci-scripts/main.py
View file @
c1b448cd
...
...
@@ -921,7 +921,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif
action
==
'Build_Proxy'
:
CONTAINERS
.
BuildProxy
(
HTML
)
elif
action
==
'Copy_Image_to_Test'
:
CONTAINERS
.
Copy_Image_to_Test_Server
(
HTML
)
success
=
CONTAINERS
.
Copy_Image_to_Test_Server
(
HTML
)
if
not
success
:
RAN
.
prematureExit
=
True
elif
action
==
'Deploy_Object'
:
CONTAINERS
.
DeployObject
(
HTML
,
EPC
)
if
CONTAINERS
.
exitStatus
==
1
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment