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

« back to all changes in this revision

Viewing changes to grackle/server/model.py

  • Committer: William Grant
  • Date: 2012-01-22 10:33:21 UTC
  • Revision ID: william.grant@canonical.com-20120122103321-79m4gov8cntyxpy2
grackle-create-instance can now create the keyspace too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from grackle.server.cassandra import workaround_1779
32
32
 
33
33
 
34
 
def create_schema(host, keyspace, clobber=False):
 
34
def create_schema(host, keyspace, clobber=False, create_keyspace=False):
35
35
    mgr = SystemManager(host)
36
36
 
 
37
    if create_keyspace:
 
38
        mgr.create_keyspace(keyspace, replication_factor=1)
 
39
 
37
40
    if clobber:
38
41
        for cf in mgr.get_keyspace_column_families(keyspace):
39
42
            mgr.drop_column_family(keyspace, cf)