~daisy-pluckers/daisy/trunk

« back to all changes in this revision

Viewing changes to daisy/schema.py

  • Committer: Evan Dandrea
  • Date: 2013-03-09 01:19:57 UTC
  • Revision ID: evan.dandrea@canonical.com-20130309011957-4onwo0cxmbuygs1b
Refactor configuration handling. The decision to import local_config or configuration is always handled in __init__ now, and the imported configuration is always validated and further manipulated at that point.
Fixed a bug in write_bucket_to_disk where the oops_id was overwritten as the null string.
Fixed a bug where query_bucket_versions would raise an IndexError for an empty set.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    ASCII_TYPE,
24
24
    )
25
25
 
26
 
configuration = None
27
 
try:
28
 
    import local_config as configuration
29
 
except ImportError:
30
 
    pass
31
 
if not configuration:
32
 
    from daisy import configuration
 
26
from daisy import config
33
27
from oopsrepository.cassandra import workaround_1779
34
28
from pycassa.types import CounterColumnType
35
29
 
36
30
def create():
37
 
    keyspace = configuration.cassandra_keyspace
38
 
    creds = {'username': configuration.cassandra_username,
39
 
             'password': configuration.cassandra_password}
40
 
    mgr = SystemManager(configuration.cassandra_hosts[0], credentials=creds)
 
31
    keyspace = config.cassandra_keyspace
 
32
    creds = {'username': config.cassandra_username,
 
33
             'password': config.cassandra_password}
 
34
    mgr = SystemManager(config.cassandra_hosts[0], credentials=creds)
41
35
    cfs = mgr.get_keyspace_column_families(keyspace).keys()
42
36
    try:
43
37
        if 'Indexes' not in cfs: