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
Titouan Soulard
slapos.core
Commits
c7ebe964
Commit
c7ebe964
authored
Nov 15, 2018
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portredir: Raise exception if socat executable is not found
parent
d030388c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
slapos/manager/devperm.py
slapos/manager/devperm.py
+0
-7
slapos/manager/portredir.py
slapos/manager/portredir.py
+5
-1
No files found.
slapos/manager/devperm.py
View file @
c7ebe964
...
@@ -10,13 +10,6 @@ from zope import interface
...
@@ -10,13 +10,6 @@ from zope import interface
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
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
):
class
Manager
(
object
):
interface
.
implements
(
IManager
)
interface
.
implements
(
IManager
)
...
...
slapos/manager/portredir.py
View file @
c7ebe964
...
@@ -16,6 +16,7 @@ def _format_ip_addr(ip_addr):
...
@@ -16,6 +16,7 @@ def _format_ip_addr(ip_addr):
return
str
(
ip_addr
)
return
str
(
ip_addr
)
def
which
(
exename
):
def
which
(
exename
):
# BBB: In Python 3, shutil.which must be used
for
path
in
os
.
environ
[
"PATH"
].
split
(
os
.
pathsep
):
for
path
in
os
.
environ
[
"PATH"
].
split
(
os
.
pathsep
):
full_path
=
os
.
path
.
join
(
path
,
exename
)
full_path
=
os
.
path
.
join
(
path
,
exename
)
if
os
.
path
.
exists
(
full_path
):
if
os
.
path
.
exists
(
full_path
):
...
@@ -127,7 +128,10 @@ class Manager(object):
...
@@ -127,7 +128,10 @@ class Manager(object):
logger
.
warning
(
'Bad source address provided'
,
exc_info
=
True
)
logger
.
warning
(
'Bad source address provided'
,
exc_info
=
True
)
continue
continue
command
=
[
which
(
'socat'
)]
socat_path
=
which
(
'socat'
)
if
not
socat_path
:
raise
OSError
(
"Path to socat executable does not exist"
)
command
=
[
socat_path
]
socat_source_version
=
source_addr
.
version
if
source_addr
is
not
None
else
4
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
)
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