(no commit message)

This commit is contained in:
wn
2008-08-12 16:18:57 +02:00
parent c45651cfe3
commit fcd8901bb9
7 changed files with 196 additions and 179 deletions

View File

@ -2,6 +2,7 @@ import SocketServer
import threading import threading
import cmd import cmd
import sys import sys
import time
import Entry import Entry
from logger import Logger from logger import Logger
@ -39,6 +40,22 @@ class MyCmd(cmd.Cmd):
except LocalMyCmdException, e: except LocalMyCmdException, e:
self.stdout.write("Failure: %s\n" % str(e.msg)) self.stdout.write("Failure: %s\n" % str(e.msg))
def do_reset(self, l):
try:
parts = l.split(' ')
if len(parts) != 1:
raise LocalMyCmdException("illegal number of arguments")
x = parts[0]
if MyCmd.entries.has_key(x):
entries[x].address = '0.0.0.0'
entries[x].addressInDns = '0.0.0.0'
entries[x].lastEventTime = int(time.time())
self.stdout.write(str(MyCmd.entries[x]) + "\n")
else:
raise LocalMyCmdException("unknown dynid")
except LocalMyCmdException, e:
self.stdout.write("Failure: %s\n" % str(e.msg))
def do_add(self, l): def do_add(self, l):
try: try:
parts = l.split(' ') parts = l.split(' ')