--- /dev/null
+# This is an interface definition of classes that are generated within C++.
+# Used by mypy to do proper type checking of mgr modules.
+# Without this file, all classes have undefined base classes.
+
+class BasePyOSDMap(object):
+ def _get_epoch(self): ...
+ def _get_crush_version(self): ...
+ def _dump(self):...
+ def _new_incremental(self):...
+ def _apply_incremental(self, inc:int):...
+ def _get_crush(self):...
+ def _get_pools_by_take(self, take):...
+ def _calc_pg_upmaps(self, inc, max_deviation, max_iterations, pool):...
+ def _map_pool_pgs_up(self, poolid):...
+ def _pg_to_up_acting_osds(self, pool_id, ps):...
+ def _pool_raw_used_rate(self, pool_id):...
+
+class BasePyOSDMapIncremental(object):
+ def _get_epoch(self):...
+ def _dump(self):...
+ def _set_osd_reweights(self, weightmap):...
+ def _set_crush_compat_weight_set_weights(self, weightmap):...
+
+class BasePyCRUSH(object):
+ def _dump(self):...
+ def _get_item_weight(self, item):...
+ def _get_item_name(self, item):...
+ def _find_takes(self):...
+ def _get_take_weight_osd_map(self, root):...
+
+class BaseMgrStandbyModule(object):
+ def __init__(self, capsule): pass
+ def _ceph_get_mgr_id(self):...
+ def _ceph_get_module_option(self, key, prefix=None):...
+ def _ceph_get_option(self, key):...
+ def _ceph_get_store(self, key):...
+ def _ceph_get_active_uri(self):...
+
+class BaseMgrModule(object):
+ def __init__(self, py_modules_ptr, this_ptr): pass
+ def _ceph_get_version(self):...
+ def _ceph_get_release_name(self):...
+ def _ceph_cluster_log(self, channel, priority, message):...
+ def _ceph_get_context(self):...
+ def _ceph_get(self, data_name):...
+ def _ceph_get_server(self, hostname):...
+ def _ceph_get_perf_schema(self, svc_type, svc_name):...
+ def _ceph_get_counter(self, svc_type, svc_name, path):...
+ def _ceph_get_latest_counter(self, svc_type, svc_name, path):...
+ def _ceph_get_metadata(self, svc_type, svc_id):...
+ def _ceph_get_daemon_status(self, svc_type, svc_id):...
+ def _ceph_send_command(self, *args, **kwargs):...
+ def _ceph_set_health_checks(self, checks):...
+ def _ceph_get_mgr_id(self):...
+ def _ceph_get_option(self, key):...
+ def _ceph_get_module_option(self, key, default, localized_prefix=""):...
+ def _ceph_get_store_prefix(self, key_prefix):...
+ def _ceph_set_module_option(self, module, key, val):...
+ def _ceph_set_store(self, key, val):...
+ def _ceph_get_store(self, key):...
+ def _ceph_get_osdmap(self):...
+ def _ceph_set_uri(self, uri):...
+ def _ceph_have_mon_connection(self):...
+ def _ceph_update_progress_event(self, evid, desc, progress):...
+ def _ceph_complete_progress_event(self, evid):...
+ def _ceph_clear_all_progress_events(self):...
+ def _ceph_dispatch_remote(self, module_name, method_name, *args, **kwargs):...
+ def _ceph_add_osd_perf_query(self, query):...
+ def _ceph_remove_osd_perf_query(self, query_id):...
+ def _ceph_get_osd_perf_counters(self, query_id):...
+ def _ceph_unregister_client(self, addrs):...
+ def _ceph_register_client(self, addrs):...
+ def _ceph_is_authorized(self, arguments):...
ssh_options = [] # type: List[str]
# ssh_config
- ssh_config_fname = self.ssh_config_file
+ ssh_config_fname = self.ssh_config_file # type: ignore
ssh_config = self.get_store("ssh_config")
if ssh_config is not None or ssh_config_fname is None:
if not ssh_config:
self._ssh_options = None
self.log.info('ssh_options %s' % ssh_options)
- if self.mode == 'root':
+ if self.mode == 'root': # type: ignore
self.ssh_user = 'root'
- elif self.mode == 'cephadm-package':
+ elif self.mode == 'cephadm-package': # type: ignore
self.ssh_user = 'cephadm'
@staticmethod
final_args += ['--fsid', self._cluster_fsid]
final_args += args
- if self.mode == 'root':
+ if self.mode == 'root': # type: ignore
self.log.debug('args: %s' % (' '.join(final_args)))
self.log.debug('stdin: %s' % stdin)
script = 'injected_argv = ' + json.dumps(final_args) + '\n'
if error_ok:
return '', str(e), 1
raise
- elif self.mode == 'cephadm-package':
+ elif self.mode == 'cephadm-package': # type: ignore
try:
out, err, code = remoto.process.check(
conn,
if error_ok:
return '', str(e), 1
raise
+ else:
+ assert False, 'unsupported mode'
+
if code and not error_ok:
raise RuntimeError(
'cephadm exited with an error code: %d, stderr:%s' % (
keys = [node_name]
for host, host_info in self.service_cache.items_filtered(keys):
hosts.append(host)
- if host_info.outdated(self.service_cache_timeout) or refresh:
+ if host_info.outdated(self.service_cache_timeout) or refresh: # type: ignore
self.log.info("refreshing stale services for '{}'".format(host))
wait_for_args.append((host,))
else:
def _get_inventory(host, host_info):
# type: (str, orchestrator.OutdatableData) -> orchestrator.InventoryNode
- if host_info.outdated(self.inventory_cache_timeout) or refresh:
+ if host_info.outdated(self.inventory_cache_timeout) or refresh: # type: ignore
self.log.info("refresh stale inventory for '{}'".format(host))
out, err, code = self._run_cephadm(
host, 'osd',
def upgrade_check(self, image, version):
if version:
- target_name = self.container_image_base + ':v' + version
+ target_name = self.container_image_base + ':v' + version # type: ignore
elif image:
target_name = image
else:
def upgrade_start(self, image, version):
if version:
- target_name = self.container_image_base + ':v' + version
+ target_name = self.container_image_base + ':v' + version # type: ignore
elif image:
target_name = image
else: