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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
4bf7c45b
Commit
4bf7c45b
authored
Sep 24, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SSHConnection class: don't exit, raise Exception to have main loop handle
parent
1620994f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ci-scripts/sshconnection.py
ci-scripts/sshconnection.py
+5
-5
No files found.
ci-scripts/sshconnection.py
View file @
4bf7c45b
...
...
@@ -100,7 +100,7 @@ class SSHConnection():
if
connect_status
:
self
.
command
(
'unset HISTFILE'
,
prompt
,
5
,
silent
=
True
)
else
:
sys
.
exit
(
'SSH Connection Failed'
)
raise
ConnectionError
(
'SSH Connection Failed'
)
self
.
ipaddress
=
ipaddress
self
.
username
=
username
...
...
@@ -136,20 +136,20 @@ class SSHConnection():
logging
.
error
(
'
\u001B
[1;37;41m Unexpected EOF
\u001B
[0m'
)
logging
.
error
(
'Expected Line : '
+
expectedline
)
logging
.
error
(
str
(
self
.
ssh
.
before
))
sys
.
exit
(
self
.
sshresponse
)
raise
ConnectionError
(
self
.
sshresponse
)
elif
self
.
sshresponse
==
2
:
logging
.
error
(
'
\u001B
[1;37;41m Unexpected TIMEOUT
\u001B
[0m'
)
logging
.
error
(
'Expected Line : '
+
expectedline
)
result
=
re
.
search
(
'ping |iperf |picocom'
,
str
(
commandline
))
if
result
is
None
:
logging
.
warning
(
str
(
self
.
ssh
.
before
))
sys
.
exit
(
self
.
sshresponse
)
raise
ConnectionError
(
self
.
sshresponse
)
else
:
return
-
1
else
:
logging
.
error
(
'
\u001B
[1;37;41m Unexpected Others
\u001B
[0m'
)
logging
.
error
(
'Expected Line : '
+
expectedline
)
sys
.
exit
(
self
.
sshresponse
)
raise
ConnectionError
(
self
.
sshresponse
)
def
command2
(
self
,
commandline
,
timeout
,
silent
=
False
):
if
not
silent
:
...
...
@@ -275,7 +275,7 @@ class SSHConnection():
if
copy_status
:
pass
else
:
sys
.
exit
(
'SCP failed'
)
raise
ConnectionError
(
'SCP failed'
)
def
getBefore
(
self
):
return
self
.
ssh
.
before
.
decode
(
'utf-8'
)
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