Commit 0ed66f62 authored by Tristan Cavelier's avatar Tristan Cavelier

fix some naming conventions

parent 11845745
...@@ -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',
......
...@@ -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_opened(ip_address, port): def isLocalTcpPortOpened(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_opened(sys.argv[1], int(sys.argv[2])): if isLocalTcpPortOpened(sys.argv[1], int(sys.argv[2])):
return 0 return 0
return 1 return 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment