Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mingxuan Li
openairinterface5G
Commits
d5eb5ee0
Commit
d5eb5ee0
authored
1 year ago
by
Jaroslava Fiedlerova
Committed by
Robert Schmidt
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Support for context manager in cls_cmd SSH class
parent
c99db698
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci-scripts/cls_cmd.py
+12
-0
12 additions, 0 deletions
ci-scripts/cls_cmd.py
with
12 additions
and
0 deletions
ci-scripts/cls_cmd.py
+
12
−
0
View file @
d5eb5ee0
...
...
@@ -86,6 +86,12 @@ class Cmd(metaclass=abc.ABCMeta):
return
class
LocalCmd
(
Cmd
):
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
exc_type
,
exc_value
,
exc_traceback
):
self
.
close
()
def
__init__
(
self
,
d
=
None
):
self
.
cwd
=
d
if
self
.
cwd
is
not
None
:
...
...
@@ -128,6 +134,12 @@ class LocalCmd(Cmd):
self
.
copyin
(
src
,
tgt
,
recursive
)
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
):
cIdx
=
0
logging
.
getLogger
(
'
paramiko
'
).
setLevel
(
logging
.
ERROR
)
# prevent spamming through Paramiko
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment