Commit bac2f9c9 authored by Austin Clements's avatar Austin Clements

Disabled line buffering on output. Rearranged link type discovery

code that that internationalism is higher priority than supposed
I2ism.
parent 67234209
......@@ -45,6 +45,12 @@ NAMED_SETUP = "@prefix@/sbin/named_setup";
verbose = 0
debug = 0
#
# Disable line buffering
#
sys.stdout = os.fdopen(sys.stdout.fileno(), sys.stdout.mode, 0)
#
# Database functions
#
......@@ -320,20 +326,6 @@ class Plab:
This can't detect DSL links, but those are probably rare for
Plab nodes.
"""
# Is host on I2?
traceroute = os.popen("traceroute -nm 10 -q 1 %s" % ip)
trace = traceroute.read()
traceroute.close()
for gw in MAGIC_INET2_GATEWAYS:
if trace.find(gw) != -1:
return "inet2"
for gw in MAGIC_INET_GATEWAYS:
if trace.find(gw) != -1:
break
else:
print "WARNING: Unknown gateway for host %s" % ip
# Is host international?
from socket import gethostbyaddr, getfqdn, herror
try:
......@@ -351,6 +343,20 @@ class Plab:
if hostname.endswith(LOCAL_PLAB_DOMAIN):
return LOCAL_PLAB_LINKTYPE
# Is host on I2?
traceroute = os.popen("traceroute -nm 10 -q 1 %s" % ip)
trace = traceroute.read()
traceroute.close()
for gw in MAGIC_INET2_GATEWAYS:
if trace.find(gw) != -1:
return "inet2"
for gw in MAGIC_INET_GATEWAYS:
if trace.find(gw) != -1:
break
else:
print "WARNING: Unknown gateway for host %s" % ip
# Must be plain 'ole Internet
return "inet"
......@@ -401,7 +407,7 @@ class Plab:
vnodetype = "pcplab%s" % linktype
for n in range(numvnodes):
vprio = (priority * 100) + (n+1)
sshdport = 38000+n
sshdport = 38000+(n+1)
vnodeid = "%s-%d" % (nodeid, n+1)
if verbose:
print "Creating vnode %s, priority %d" % (vnodeid, vprio)
......
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