Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Lu Xu
slapos.toolbox
Commits
d5dca49a
Commit
d5dca49a
authored
Oct 23, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some naming conventions
parent
11845745
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
setup.py
setup.py
+1
-1
slapos/promise/is_local_tcp_port_opened/__init__.py
slapos/promise/is_local_tcp_port_opened/__init__.py
+2
-2
No files found.
setup.py
View file @
d5dca49a
...
@@ -53,7 +53,6 @@ setup(name=name,
...
@@ -53,7 +53,6 @@ setup(name=name,
entry_points
=
{
entry_points
=
{
'console_scripts'
:
[
'console_scripts'
:
[
'agent = slapos.agent.agent:main [agent]'
,
'agent = slapos.agent.agent:main [agent]'
,
'is-local-tcp-port-opened = slapos.promise.islocaltcpportopened:main'
,
'clouddestroy = slapos.cloudmgr.destroy:main'
,
'clouddestroy = slapos.cloudmgr.destroy:main'
,
'cloudgetprivatekey = slapos.cloudmgr.getprivatekey:main'
,
'cloudgetprivatekey = slapos.cloudmgr.getprivatekey:main'
,
'cloudgetpubliciplist = slapos.cloudmgr.getpubliciplist:main'
,
'cloudgetpubliciplist = slapos.cloudmgr.getpubliciplist:main'
,
...
@@ -63,6 +62,7 @@ setup(name=name,
...
@@ -63,6 +62,7 @@ setup(name=name,
'cloudstop = slapos.cloudmgr.stop:main'
,
'cloudstop = slapos.cloudmgr.stop:main'
,
'equeue = slapos.equeue:main'
,
'equeue = slapos.equeue:main'
,
'htpasswd = slapos.htpasswd:main'
,
'htpasswd = slapos.htpasswd:main'
,
'is-local-tcp-port-opened = slapos.promise.is_local_tcp_port_opened:main'
,
'killpidfromfile = slapos.systool:killpidfromfile'
,
'killpidfromfile = slapos.systool:killpidfromfile'
,
'runResiliencyTest = slapos.resiliencytest:runResiliencyTest'
,
'runResiliencyTest = slapos.resiliencytest:runResiliencyTest'
,
'runStandaloneResiliencyTest = slapos.resiliencytest:runStandaloneResiliencyTest'
,
'runStandaloneResiliencyTest = slapos.resiliencytest:runStandaloneResiliencyTest'
,
...
...
slapos/promise/is
localtcpport
opened/__init__.py
→
slapos/promise/is
_local_tcp_port_
opened/__init__.py
View file @
d5dca49a
...
@@ -15,7 +15,7 @@ import socket
...
@@ -15,7 +15,7 @@ import socket
import
struct
import
struct
assert
struct
.
calcsize
(
'I'
)
==
4
assert
struct
.
calcsize
(
'I'
)
==
4
def
is
_local_tcp_port_o
pened
(
ip_address
,
port
):
def
is
LocalTcpPortO
pened
(
ip_address
,
port
):
family
=
socket
.
getaddrinfo
(
ip_address
,
0
)[
0
][
0
]
family
=
socket
.
getaddrinfo
(
ip_address
,
0
)[
0
][
0
]
conf
=
{
conf
=
{
socket
.
AF_INET6
:
(
4
,
"/proc/net/tcp6"
),
socket
.
AF_INET6
:
(
4
,
"/proc/net/tcp6"
),
...
@@ -31,7 +31,7 @@ def is_local_tcp_port_opened(ip_address, port):
...
@@ -31,7 +31,7 @@ def is_local_tcp_port_opened(ip_address, port):
return
any
(
full_addr_hex
==
line
.
split
()[
1
]
for
line
in
open
(
tcp_path
).
readlines
())
return
any
(
full_addr_hex
==
line
.
split
()[
1
]
for
line
in
open
(
tcp_path
).
readlines
())
def
main
():
def
main
():
if
is
_local_tcp_port_o
pened
(
sys
.
argv
[
1
],
int
(
sys
.
argv
[
2
])):
if
is
LocalTcpPortO
pened
(
sys
.
argv
[
1
],
int
(
sys
.
argv
[
2
])):
return
0
return
0
return
1
return
1
...
...
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