'prefix': 'config set',
'who': 'client.rgw.' + spec.name,
'name': 'rgw_zone',
- 'value': spec.name,
+ 'value': spec.rgw_zone,
+ })
+ ret, out, err = self.mon_command({
+ 'prefix': 'config set',
+ 'who': 'client.rgw.' + spec.rgw_realm,
+ 'name': 'rgw_realm',
+ 'value': spec.rgw_realm,
})
- daemons = self._get_services('rgw')
- results = []
- num_added = 0
- for host, _, name in spec.placement.nodes:
- if num_added >= spec.count:
- break
- rgw_id = self.get_unique_name(daemons, spec.name, name)
- self.log.debug('placing rgw.%s on host %s' % (rgw_id, host))
- results.append(
- self._worker_pool.apply_async(self._create_rgw, (rgw_id, host))
- )
- # add to daemon list so next name(s) will also be unique
- sd = orchestrator.ServiceDescription()
- sd.service_instance = rgw_id
- sd.service_type = 'rgw'
- sd.nodename = host
- daemons.append(sd)
- num_added += 1
- return SSHWriteCompletion(results)
+ def _add_rgw(daemons):
+ args = []
+ num_added = 0
+ for host, _, name in spec.placement.nodes:
+ if num_added >= spec.count:
+ break
+ rgw_id = self.get_unique_name(daemons, spec.name, name)
+ self.log.debug('placing rgw.%s on host %s' % (rgw_id, host))
+ args.append((rgw_id, host))
+ # add to daemon list so next name(s) will also be unique
+ sd = orchestrator.ServiceDescription()
+ sd.service_instance = rgw_id
+ sd.service_type = 'rgw'
+ sd.nodename = host
+ daemons.append(sd)
+ num_added += 1
+ return self._create_rgw(args)
+
+ return self._get_services('rgw').then(_add_rgw)
+
+ @async_map_completion
def _create_rgw(self, rgw_id, host):
ret, keyring, err = self.mon_command({
'prefix': 'auth get-or-create',