(no commit message)
This commit is contained in:
@ -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(' ')
|
||||||
|
Reference in New Issue
Block a user