-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from ceph/mergify/bp/quincy/pr-271
tests: add mypy.ini (backport #271)
- Loading branch information
Showing
6 changed files
with
28 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# Author: Guillaume Abrioux <[email protected]> | ||
|
||
from __future__ import absolute_import, division, print_function | ||
from typing import List, Tuple | ||
from typing import Any, Dict, List, Tuple, Union | ||
__metaclass__ = type | ||
|
||
from ansible.module_utils.basic import AnsibleModule # type: ignore | ||
|
@@ -97,7 +97,7 @@ def set_option(module: "AnsibleModule", | |
return rc, cmd, out.strip(), err | ||
|
||
|
||
def get_config_dump(module: "AnsibleModule"): | ||
def get_config_dump(module: "AnsibleModule") -> Tuple[int, List[str], str, str]: | ||
cmd = build_base_cmd_shell(module) | ||
cmd.extend(['ceph', 'config', 'dump', '--format', 'json']) | ||
rc, out, err = module.run_command(cmd) | ||
|
@@ -107,7 +107,7 @@ def get_config_dump(module: "AnsibleModule"): | |
return rc, cmd, out, err | ||
|
||
|
||
def get_current_value(who, option, config_dump): | ||
def get_current_value(who: str, option: str, config_dump: List[Dict[str, Any]]) -> Union[str, None]: | ||
for config in config_dump: | ||
if config['section'] == who and config['name'] == option: | ||
return config['value'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[mypy] | ||
strict_optional = True | ||
no_implicit_optional = True | ||
warn_incomplete_stub = True | ||
check_untyped_defs = True | ||
show_error_context = True | ||
allow_redefinition = True | ||
disallow_untyped_defs = True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters