~ubuntu-branches/ubuntu/utopic/ceilometer/utopic-proposed

« back to all changes in this revision

Viewing changes to ceilometer/api/hooks.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-10-16 14:07:11 UTC
  • mfrom: (1.2.1) (28.1.5 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20141016140711-95mki6bdkivvfr2x
Tags: 2014.2-0ubuntu1
New upstream release. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
 
27
27
class ConfigHook(hooks.PecanHook):
28
 
    """Attach the configuration object to the request
29
 
    so controllers can get to it.
 
28
    """Attach the configuration object to the request.
 
29
 
 
30
    That allows controllers to get it.
30
31
    """
31
32
 
32
33
    def before(self, state):
35
36
 
36
37
class DBHook(hooks.PecanHook):
37
38
 
38
 
    def __init__(self, storage_connection):
 
39
    def __init__(self, storage_connection, alarm_storage_connection):
39
40
        self.storage_connection = storage_connection
 
41
        self.alarm_storage_connection = alarm_storage_connection
40
42
 
41
43
    def before(self, state):
42
44
        state.request.storage_conn = self.storage_connection
 
45
        state.request.alarm_storage_conn = self.alarm_storage_connection
43
46
 
44
47
 
45
48
class PipelineHook(hooks.PecanHook):
46
 
    '''Create and attach a pipeline to the request so that
47
 
    new samples can be posted via the /v2/meters/ API.
48
 
    '''
 
49
    """Create and attach a pipeline to the request.
 
50
 
 
51
    That allows new samples to be posted via the /v2/meters/ API.
 
52
    """
49
53
 
50
54
    def __init__(self):
51
55
        # this is done here as the cfg options are not available