~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/local-latency

  • Committer: Aaron Bentley
  • Date: 2011-08-04 20:44:08 UTC
  • mto: This revision was merged to the branch mainline in revision 13619.
  • Revision ID: aaron@canonical.com-20110804204408-wu7ozxhn0k3dn9qu
Remove Command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import subprocess
7
7
 
8
8
from script_commands import (
9
 
    Command,
 
9
    helps,
 
10
    run_subcommand,
10
11
    UserError,
11
12
    types,
12
 
    helps,
13
13
    )
14
14
 
15
15
 
29
29
       ' sport %d 0xffff flowid 1:3' % port)
30
30
 
31
31
 
32
 
Command.commands['start'] = start
33
 
 
34
 
 
35
32
def stop():
36
33
    tc('qdisc del dev lo root')
37
34
 
38
35
 
39
 
Command.commands['stop'] = stop
 
36
subcommands = {
 
37
    'start': start,
 
38
    'stop': stop,
 
39
    }
40
40
 
41
41
 
42
42
 
43
43
if __name__ == "__main__":
44
44
    try:
45
 
        Command.run_subcommand(sys.argv[1:])
 
45
        run_subcommand(subcommands, sys.argv[1:])
46
46
    except UserError as e:
47
47
        sys.stderr.write(str(e)+'\n')