~aluria/charms/trusty/cinder-backup/trunk

« back to all changes in this revision

Viewing changes to hooks/contexts.py

  • Committer: Alvaro Uría
  • Date: 2015-04-16 16:06:54 UTC
  • Revision ID: alvaro.uria@canonical.com-20150416160654-ognukdygbyxgnq8p
correcting calls from renaming + new Context class

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from charmhelpers.core.hookenv import (
2
 
    config,
3
 
    relation_ids,
4
 
    service_name,
5
 
    related_units,
6
 
    relation_get
 
2
    config
 
3
#    config,
 
4
#    relation_ids,
 
5
#    service_name,
 
6
#    related_units,
 
7
#    relation_get
7
8
)
8
9
 
9
10
from charmhelpers.contrib.openstack.context import (
10
11
    OSContextGenerator,
11
12
)
12
13
 
13
 
from charmhelpers.contrib.openstack.utils import (
14
 
    get_os_codename_install_source
15
 
)
16
 
 
 
14
#from charmhelpers.contrib.openstack.utils import (
 
15
#    get_os_codename_install_source
 
16
#)
 
17
 
 
18
class CinderBackupContext(OSContextGenerator):
 
19
    interfaces = ['cinder']
 
20
 
 
21
    def __call__(self):
 
22
        ctxt = {
 
23
            'backup_driver': config('backup-driver'),
 
24
            'backup_swift_url': config('backup-swift-url'),
 
25
            'backup_swift_auth': config('backup-swift-auth'),
 
26
            'backup_swift_auth_version': config('backup-swift-auth-version'),
 
27
            'backup_swift_user': config('backup-swift-user'),
 
28
            'backup_swift_key': config('backup-swift-key'),
 
29
            'backup_swift_container': config('backup-swift-container'),
 
30
            'backup_swift_object_size': config('backup-swift-object-size'),
 
31
            'backup_swift_retry_attempts': config('backup-swift-retry-attempts'),
 
32
            'backup_swift_retry_backoff': config('backup-swift-retry-backoff'),
 
33
            'backup_compression_algorithm': config('backup-compression-algorithm')
 
34
        }
 
35
 
 
36
        return ctxt
17
37
 
18
38
class LoggingConfigContext(OSContextGenerator):
19
39