~jseutter/charms/precise/cinder/ha-support-with-health

« back to all changes in this revision

Viewing changes to hooks/cinder-hooks

  • Committer: Adam Gandelman
  • Date: 2013-02-26 16:59:34 UTC
  • mfrom: (33.1.1 cinder)
  • Revision ID: adamg@canonical.com-20130226165934-p5adqm9bu12sygmh
Merge James' leadership fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
  # in preparation for move to start-stop-daemon.
177
177
  echo "env CEPH_ARGS=\"--id $SERVICE_NAME\"" > /etc/init/cinder-volume.override
178
178
 
179
 
  # Create the cinder pool if it does not already exist
180
 
  if ! rados --id $SERVICE_NAME lspools | grep -q cinder; then
181
 
    rados --id $SERVICE_NAME mkpool cinder
 
179
  # Only the leader should try to create pools
 
180
  if eligible_leader 'res_cinder_vip'; then
 
181
    # Create the cinder pool if it does not already exist
 
182
    if ! rados --id $SERVICE_NAME lspools | grep -q cinder; then
 
183
      rados --id $SERVICE_NAME mkpool cinder
 
184
    fi
182
185
  fi
183
186
 
184
187
  # Reconfigure cinder-volume