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
d5eb5ee0
Commit
d5eb5ee0
authored
Dec 28, 2023
by
Jaroslava Fiedlerova
Committed by
Robert Schmidt
Mar 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for context manager in cls_cmd SSH class
parent
c99db698
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
ci-scripts/cls_cmd.py
ci-scripts/cls_cmd.py
+12
-0
No files found.
ci-scripts/cls_cmd.py
View file @
d5eb5ee0
...
@@ -86,6 +86,12 @@ class Cmd(metaclass=abc.ABCMeta):
...
@@ -86,6 +86,12 @@ class Cmd(metaclass=abc.ABCMeta):
return
return
class
LocalCmd
(
Cmd
):
class
LocalCmd
(
Cmd
):
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
exc_type
,
exc_value
,
exc_traceback
):
self
.
close
()
def
__init__
(
self
,
d
=
None
):
def
__init__
(
self
,
d
=
None
):
self
.
cwd
=
d
self
.
cwd
=
d
if
self
.
cwd
is
not
None
:
if
self
.
cwd
is
not
None
:
...
@@ -128,6 +134,12 @@ class LocalCmd(Cmd):
...
@@ -128,6 +134,12 @@ class LocalCmd(Cmd):
self
.
copyin
(
src
,
tgt
,
recursive
)
self
.
copyin
(
src
,
tgt
,
recursive
)
class
RemoteCmd
(
Cmd
):
class
RemoteCmd
(
Cmd
):
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
exc_type
,
exc_value
,
exc_traceback
):
self
.
close
()
def
__init__
(
self
,
hostname
,
d
=
None
):
def
__init__
(
self
,
hostname
,
d
=
None
):
cIdx
=
0
cIdx
=
0
logging
.
getLogger
(
'paramiko'
).
setLevel
(
logging
.
ERROR
)
# prevent spamming through Paramiko
logging
.
getLogger
(
'paramiko'
).
setLevel
(
logging
.
ERROR
)
# prevent spamming through Paramiko
...
...
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