We now return the correct Py types, just like we do for module options.
Signed-off-by: Sage Weil <sage@redhat.com>
def optimize(self, plan):
self.log.info('Optimize plan %s' % plan.name)
plan.mode = self.get_module_option('mode')
- max_misplaced = float(self.get_ceph_option('target_max_misplaced_ratio'))
+ max_misplaced = self.get_ceph_option('target_max_misplaced_ratio')
self.log.info('Mode %s, max misplaced %f' %
(plan.mode, max_misplaced))
step = self.get_module_option('crush_compat_step')
if step <= 0 or step >= 1.0:
return -errno.EINVAL, '"crush_compat_step" must be in (0, 1)'
- max_misplaced = float(self.get_ceph_option('target_max_misplaced_ratio'))
+ max_misplaced = self.get_ceph_option('target_max_misplaced_ratio')
min_pg_per_osd = 2
ms = plan.initial
# Use mgr_tick_period (default: 2) here just to illustrate
# consuming native ceph options. Any real background work
# would presumably have some more appropriate frequency.
- sleep_interval = int(self.mgr_tick_period)
+ sleep_interval = self.mgr_tick_period
self.log.debug('Sleeping for %d seconds', sleep_interval)
ret = self.event.wait(sleep_interval)
self.event.clear()
all_stats = self.get('osd_stats')
for s in roots:
s.osd_count = len(s.osds)
- s.pg_target = s.osd_count * int(self.mon_target_pg_per_osd)
+ s.pg_target = s.osd_count * self.mon_target_pg_per_osd
capacity = 0.0
for osd_stats in all_stats['osd_stats']:
self.process_raw_osd_perf_counters()
self.refresh_condition.notify()
- stats_period = int(self.module.get_ceph_option("mgr_stats_period"))
+ stats_period = self.module.get_ceph_option("mgr_stats_period")
self.query_condition.wait(stats_period)
self.log.debug("PerfHandler: tick")