sm[n].container_image_name = 'mix'
if dd.daemon_type == 'haproxy' or dd.daemon_type == 'keepalived':
# ha-rgw has 2 daemons running per host
- sm[n].size = sm[n].size*2
+ sm[n].size = sm[n].size * 2
for n, spec in self.spec_store.specs.items():
if n in sm:
continue
sm[n].rados_config_location = spec.rados_config_location()
if spec.service_type == 'ha-rgw':
# ha-rgw has 2 daemons running per host
- sm[n].size = sm[n].size*2
+ sm[n].size = sm[n].size * 2
return list(sm.values())
@trivial_completion
logger.debug('Provided hosts: %s' % candidates)
# if asked to place even number of mons, deploy 1 less
if self.spec.service_type == 'mon' and (len(candidates) % 2) == 0:
+ count = len(candidates) - 1
logger.info("Deploying %s monitor(s) instead of %s so monitors may achieve consensus" % (
- len(candidates) - 1, len(candidates)))
- return candidates[0:len(candidates)-1]
+ count, len(candidates)))
+ return candidates[0:count]
# do not deploy ha-rgw on hosts that don't support virtual ips
if self.spec.service_type == 'ha-rgw' and self.filter_new_host:
def test_trivial(self, cephadm_module):
@trivial_completion
def run(x):
- return x+1
+ return x + 1
assert wait(cephadm_module, run(1)) == 2
def test_exception(self, cephadm_module):
mgr.process = lambda cs: [c.finalize(None) for c in cs]
def add_one(x):
- return x+1
+ return x + 1
c = Completion(value=1, on_complete=add_one).then(
str
[flake8]
max-line-length = 100
ignore =
- E226,
E231,
E241,
E261,