Merge lp:~lomov-as/charms/trusty/cf-go-router/trunk into lp:~cf-charmers/charms/trusty/cf-go-router/trunk

Proposed by Alex Lomov
Status: Merged
Approved by: Alexandr Prismakov
Approved revision: 24
Merged at revision: 24
Proposed branch: lp:~lomov-as/charms/trusty/cf-go-router/trunk
Merge into: lp:~cf-charmers/charms/trusty/cf-go-router/trunk
Diff against target: 81 lines (+32/-13)
2 files modified
hooks/charmhelpers/contrib/cloudfoundry/common.py (+8/-6)
hooks/charmhelpers/contrib/cloudfoundry/contexts.py (+24/-7)
To merge this branch: bzr merge lp:~lomov-as/charms/trusty/cf-go-router/trunk
Reviewer Review Type Date Requested Status
Alexandr Prismakov (community) Approve
Review via email: mp+219174@code.launchpad.net

Description of the change

Use new versions of cf-loggregator

Changed relation names

To post a comment you must log in.
Revision history for this message
Alex Lomov (lomov-as) wrote :

Please take a look.

Revision history for this message
Alexandr Prismakov (prismakov) wrote :

Reviewed, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/charmhelpers/contrib/cloudfoundry/common.py'
--- hooks/charmhelpers/contrib/cloudfoundry/common.py 2014-04-13 18:00:04 +0000
+++ hooks/charmhelpers/contrib/cloudfoundry/common.py 2014-05-12 11:23:58 +0000
@@ -48,9 +48,9 @@
48 gid = grp.getgrnam(group).gr_gid48 gid = grp.getgrnam(group).gr_gid
49 for root, dirs, files in os.walk(path):49 for root, dirs, files in os.walk(path):
50 for momo in dirs:50 for momo in dirs:
51 os.lchown(os.path.join(root, momo), uid, gid)51 os.chown(os.path.join(root, momo), uid, gid)
52 for momo in files:52 for momo in files:
53 os.lchown(os.path.join(root, momo), uid, gid)53 os.chown(os.path.join(root, momo), uid, gid)
5454
5555
56@contextmanager56@contextmanager
@@ -63,7 +63,9 @@
6363
6464
65def prepare_cloudfoundry_environment(config_data, packages):65def prepare_cloudfoundry_environment(config_data, packages):
66 add_source(config_data['source'], config_data.get('key'))66 if 'source' in config_data:
67 apt_update(fatal=True)67 add_source(config_data['source'], config_data.get('key'))
68 apt_install(packages=filter_installed_packages(packages), fatal=True)68 apt_update(fatal=True)
69 if packages:
70 apt_install(packages=filter_installed_packages(packages), fatal=True)
69 host.adduser('vcap')71 host.adduser('vcap')
7072
=== modified file 'hooks/charmhelpers/contrib/cloudfoundry/contexts.py'
--- hooks/charmhelpers/contrib/cloudfoundry/contexts.py 2014-04-03 18:19:32 +0000
+++ hooks/charmhelpers/contrib/cloudfoundry/contexts.py 2014-05-12 11:23:58 +0000
@@ -29,19 +29,30 @@
29 return hookenv.config()29 return hookenv.config()
3030
3131
32class StorableContext(object):
33
34 def store_context(self, file_name, config_data):
35 with open(file_name, 'w') as file_stream:
36 yaml.dump(config_data, file_stream)
37
38 def read_context(self, file_name):
39 with open(file_name, 'r') as file_stream:
40 data = yaml.load(file_stream)
41 if not data:
42 raise OSError("%s is empty" % file_name)
43 return data
44
45
32# Stores `config_data` hash into yaml file with `file_name` as a name46# Stores `config_data` hash into yaml file with `file_name` as a name
33# if `file_name` already exists, then it loads data from `file_name`.47# if `file_name` already exists, then it loads data from `file_name`.
34class StoredContext(OSContextGenerator):48class StoredContext(OSContextGenerator, StorableContext):
49
35 def __init__(self, file_name, config_data):50 def __init__(self, file_name, config_data):
36 self.data = config_data51 self.data = config_data
37 if os.path.exists(file_name):52 if os.path.exists(file_name):
38 with open(file_name, 'r') as file_stream:53 self.data = self.read_context(file_name)
39 self.data = yaml.load(file_stream)
40 if not self.data:
41 raise OSError("%s is empty" % file_name)
42 else:54 else:
43 with open(file_name, 'w') as file_stream:55 self.store_context(file_name, config_data)
44 yaml.dump(config_data, file_stream)
45 self.data = config_data56 self.data = config_data
4657
47 def __call__(self):58 def __call__(self):
@@ -64,3 +75,9 @@
64class RouterContext(RelationContext):75class RouterContext(RelationContext):
65 interface = 'router'76 interface = 'router'
66 required_keys = ['domain']77 required_keys = ['domain']
78
79
80class LoggregatorContext(RelationContext):
81 interface = 'loggregator'
82 required_keys = ['shared_secret', 'loggregator_address']
83

Subscribers

People subscribed via source and target branches