~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle-create-instance

  • Committer: Curtis Hovey
  • Date: 2012-03-16 19:38:35 UTC
  • mto: This revision was merged to the branch mainline in revision 45.
  • Revision ID: curtis.hovey@canonical.com-20120316193835-egu5tc1n0xlr5udj
Rename args to be honest about what is expected.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
from optparse import OptionParser
4
 
 
5
 
from grackle.model import create_schema
6
 
 
7
 
 
8
 
parser = OptionParser(usage="usage: %prog [options] <hostname> <keyspace>")
9
 
parser.add_option(
10
 
    "--clobber", action="store_true", default=False, dest="clobber",
11
 
    help="clear the keyspace before initialising it")
12
 
parser.add_option(
13
 
    "--create-keyspace", action="store_true", default=False,
14
 
    dest="create_keyspace",
15
 
    help="create the keyspace (with SimpleStrategy, RF=1)")
16
 
options, args = parser.parse_args()
17
 
 
18
 
if len(args) != 2:
19
 
    parser.error("hostname and keyspace required")
20
 
 
21
 
create_schema(
22
 
    args[0], args[1], clobber=options.clobber,
23
 
    create_keyspace=options.create_keyspace)