~james-page/charms/trusty/glance/lp1456379-stable

« back to all changes in this revision

Viewing changes to hooks/glance_relations.py

  • Committer: Edward Hope-Morley
  • Date: 2015-05-01 11:37:27 UTC
  • Revision ID: edward.hope-morley@canonical.com-20150501113727-m8lj8j0yl3zm0iej
[hopem,r=wolsen]

Ensure glance-api service is restarted when we recieve
ack from ceph broker request so that we are sure it is
able to connect to newly created ceph resources.

Backported from /next
Closes-Bug: 1450543

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
from charmhelpers.core.host import (
45
45
    restart_on_change,
46
46
    service_reload,
 
47
    service_restart,
47
48
    service_stop,
48
49
)
49
50
from charmhelpers.fetch import (
265
266
                 (rsp.exit_code, rsp.exit_msg), level=INFO)
266
267
        CONFIGS.write(GLANCE_API_CONF)
267
268
        CONFIGS.write(ceph_config_file())
 
269
        # Ensure that glance-api is restarted since only now can we
 
270
        # guarantee that ceph resources are ready.
 
271
        service_restart('glance-api')
268
272
    else:
269
273
        rq = CephBrokerRq()
270
274
        replicas = config('ceph-osd-replication-count')