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
3feaa93b
Commit
3feaa93b
authored
Sep 26, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cls_cmd: print the host on which a command is executed
parent
0d63861b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
ci-scripts/cls_cmd.py
ci-scripts/cls_cmd.py
+5
-4
No files found.
ci-scripts/cls_cmd.py
View file @
3feaa93b
...
...
@@ -101,7 +101,7 @@ class LocalCmd(Cmd):
def
run
(
self
,
line
,
timeout
=
300
,
silent
=
False
,
reportNonZero
=
True
):
if
not
silent
:
logging
.
info
(
line
)
logging
.
info
(
f"local>
{
line
}
"
)
try
:
if
line
.
strip
().
endswith
(
'&'
):
# if we wait for stdout, subprocess does not return before the end of the command
...
...
@@ -168,6 +168,7 @@ class RemoteCmd(Cmd):
def
__init__
(
self
,
hostname
,
d
=
None
):
cIdx
=
0
self
.
hostname
=
hostname
logging
.
getLogger
(
'paramiko'
).
setLevel
(
logging
.
ERROR
)
# prevent spamming through Paramiko
self
.
client
=
paramiko
.
SSHClient
()
self
.
client
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
...
...
@@ -205,7 +206,7 @@ class RemoteCmd(Cmd):
def
run
(
self
,
line
,
timeout
=
300
,
silent
=
False
,
reportNonZero
=
True
):
if
not
silent
:
logging
.
info
(
line
)
logging
.
info
(
f"ssh[
{
self
.
hostname
}
]>
{
line
}
"
)
if
self
.
cwd
:
line
=
f"cd
{
self
.
cwd
}
&&
{
line
}
"
try
:
...
...
@@ -235,7 +236,7 @@ class RemoteCmd(Cmd):
# if recursive is True, tgt must be a directory (and src is file or directory)
# if recursive is False, tgt and src must be a file name
def
copyout
(
self
,
src
,
tgt
,
recursive
=
False
):
logging
.
debug
(
f"copyout: local:
{
src
}
->
remote
:
{
tgt
}
"
)
logging
.
debug
(
f"copyout: local:
{
src
}
->
{
self
.
hostname
}
:
{
tgt
}
"
)
if
recursive
:
tmpfile
=
f"
{
uuid
.
uuid4
()
}
.tar"
abstmpfile
=
f"/tmp/
{
tmpfile
}
"
...
...
@@ -253,7 +254,7 @@ class RemoteCmd(Cmd):
# if recursive is True, tgt must be a directory (and src is file or directory)
# if recursive is False, tgt and src must be a file name
def
copyin
(
self
,
src
,
tgt
,
recursive
=
False
):
logging
.
debug
(
f"copyin:
remote
:
{
src
}
-> local:
{
tgt
}
"
)
logging
.
debug
(
f"copyin:
{
self
.
hostname
}
:
{
src
}
-> local:
{
tgt
}
"
)
if
recursive
:
tmpfile
=
f"
{
uuid
.
uuid4
()
}
.tar"
abstmpfile
=
f"/tmp/
{
tmpfile
}
"
...
...
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