Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Ivan Tyagov
slapos.core
Commits
b09a618f
Commit
b09a618f
authored
Jul 11, 2018
by
Guillaume Hervier
Committed by
Rafael Monnerat
Jul 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid_managers[portredir]: Search socat in PATH when running
/reviewed-on
nexedi/slapos.core!48
parent
1ac787e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
slapos/manager/portredir.py
slapos/manager/portredir.py
+9
-2
No files found.
slapos/manager/portredir.py
View file @
b09a618f
...
...
@@ -2,7 +2,7 @@
import
json
import
logging
import
netaddr
import
os
.path
import
os
from
.interface
import
IManager
from
itertools
import
ifilter
...
...
@@ -15,6 +15,13 @@ def _format_ip_addr(ip_addr):
return
'[{}]'
.
format
(
ip_addr
)
return
str
(
ip_addr
)
def
which
(
exename
):
for
path
in
os
.
environ
[
"PATH"
].
split
(
os
.
pathsep
):
full_path
=
os
.
path
.
join
(
path
,
exename
)
if
os
.
path
.
exists
(
full_path
):
return
full_path
return
None
class
Manager
(
object
):
interface
.
implements
(
IManager
)
...
...
@@ -120,7 +127,7 @@ class Manager(object):
logger
.
warning
(
'Bad source address provided'
,
exc_info
=
True
)
continue
command
=
[
'socat'
]
command
=
[
which
(
'socat'
)
]
socat_source_version
=
source_addr
.
version
if
source_addr
is
not
None
else
4
socat_source_type
=
'{rtype}{version}-LISTEN'
.
format
(
rtype
=
redir_type
.
upper
(),
version
=
socat_source_version
)
...
...
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