Commit Graph

119021 Commits

Author SHA1 Message Date
Kefu Chai
5cf5540250 mgr/zabbix: cast port to int
to appease mypy

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 19:22:05 +08:00
Kefu Chai
5cafe02168 mgr/zabbix: talk to zabbix_sender in text not bytes
as we expect read from / write to it in text mode.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 19:22:05 +08:00
Kefu Chai
aaaa321d12 mgr/zabbix: use "uint" for type of discovery_interval
we only support following types:

'uint', 'int', 'str', 'float', 'bool', 'addr', 'addrvec', 'uuid',
'size', 'secs',

see also str_to_type()

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 19:22:05 +08:00
Kefu Chai
c9513f8bf4 mgr/zabbix: add annotations
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 19:22:05 +08:00
Kefu Chai
4287066e13 mgr/zabbix: use Option for adding options
more type safety

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 19:22:05 +08:00
Kefu Chai
48438ccced mgr/devicehealth: add more annotations
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 19:22:05 +08:00
Kefu Chai
19cdc4325c pybind/mgr/mgr_module: correct annotation
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 16:30:54 +08:00
Jason Dillaman
e6ac5f0e63
Merge pull request #39086 from orozery/qa-rbd-delete-passphrase-file
qa/tasks/rbd: cleanup passphrase file

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 15:42:08 -05:00
Jason Dillaman
f8862cff1b
Merge pull request #39089 from orozery/librbd-luks-cli-test
test/librbd: fix luks encryption cli test on unsupported runs

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 15:17:12 -05:00
Ilya Dryomov
5dd7fffbb7
Merge pull request #39091 from tchaikov/wip-crimson-build
cmake: let alienstore link against zoned allocator

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-01-26 20:45:31 +01:00
Kefu Chai
6883b64205 cmake: let alienstore link against zoned allocator
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-27 02:11:26 +08:00
Sage Weil
8aba5ebcc6 Merge PR #39028 into master
* refs/pull/39028/head:
	cephadm: retry for 30s instead of 10s
	cephadm: try 'mgr stat' before 'mgr dump' to get the epoch
	mon: add 'mgr stat' command

Reviewed-by: Sebastian Wagner <swagner@suse.com>
2021-01-26 11:22:50 -06:00
Or Ozeri
2f1eb8eba0 test/librbd: fix luks encryption cli test on unsupported runs
This commit changes the luks encryption cli test to return success instead of failure when not supported.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2021-01-26 18:54:05 +02:00
Kefu Chai
ffdceb1743
Merge pull request #39077 from tchaikov/wip-libzbd
install-deps.sh: set codename when installing libzbd

Reviewed-by: David Galloway <dgallowa@redhat.com>
2021-01-26 23:34:06 +08:00
Kefu Chai
d3761ce380
Merge pull request #38935 from tchaikov/wip-mgr-ann
pybind/mgr/mgr_module: annotate more methods and add poll to CLICommand

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
Reviewed-by: Kamoltat <ksirivad@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2021-01-26 23:26:34 +08:00
Or Ozeri
8498da2aca qa/tasks/rbd: cleanup passphrase file
This commit adds a cleanup for the passphrase file used to create/mount encrypted rbd images.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2021-01-26 17:02:37 +02:00
Jason Dillaman
ff0a062871
Merge pull request #39022 from petrutlucian94/rbd_fixes
Windows RBD fixes

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 09:47:40 -05:00
Jason Dillaman
6d7acb1033
Merge pull request #38984 from petrutlucian94/dll
Windows DLL support

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 09:47:26 -05:00
Jason Dillaman
eedfe2d000
Merge pull request #39073 from tchaikov/wip-rbd-bench
rbd/bench: include used headers

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 09:47:06 -05:00
Jason Dillaman
6aba1c7bba
Merge pull request #39049 from lixiaoy1/fix_spec
spec: enable RWL/SSD caches

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 09:46:44 -05:00
Jason Dillaman
3c4e73ad4f
Merge pull request #39044 from orozery/librbd-crypto-close-bug
librbd: do not share crypto image layers with ancestors

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 09:46:35 -05:00
Jason Dillaman
988a6ac8d3
Merge pull request #39006 from orozery/librbd-luks-cli-test
test/librbd: add luks encryption cli test

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 09:46:20 -05:00
Jason Dillaman
55919f34c5
Merge pull request #39005 from orozery/librbd-plain64-iv-fix
librbd: use 512 sector size for crypto IV

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 09:45:54 -05:00
Ilya Dryomov
fcb0334156
Merge pull request #39064 from idryomov/wip-doc-osdtimeout
doc: don't mention osdtimeout option in mount.ceph man page

Reviewed-by: Jeff Layton <jlayton@redhat.com>
2021-01-26 13:37:10 +01:00
Ilya Dryomov
4cbd952916
Merge pull request #39060 from idryomov/wip-krbd-msgr2
krbd: add support for msgr2 (kernel 5.11)

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2021-01-26 11:46:08 +01:00
Kefu Chai
af43300146 install-deps.sh: set codename when installing libzbd
this was an oversight in e7e3b86762

also use updated build with sha1 of
1fadde94b08fab574b17637c2bebd2b1e7f9127b, the older version has an issue
where both libzbd and libzbd-dev packaged .pc file with the same path,
so they conflicted with each other. the new version addressed this
issue.

and install libzbd-dev instead of libzbd and libzbd-dev, as the package
name of the former could change if its so version is bumped, so use the
*-dev package is a safer choice from the perspective of testing the
dev build.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:45:09 +08:00
Kefu Chai
36dde8861a pybind/mgr/cephadm: return -ENOENT if self.ssh_user is None
there is chance that self.ssh_user is None when handling "cephadm
get-user" command, so return -ENOENT and error messages in that case.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
34e96c5539 pybind/mgr/dashboard: use _get_localized_key for composing store key
Just for keeping this 'encapsulated', there's _get_localized_key helper
in mgr_module (there's also a set_localized_store but it only deals with
the active manager)

As suggested by Ernesto Puerta <epuertat@redhat.com>

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
3ca955c4d5 pybind/mgr/prometheus: add assert to appease mypy
self.get_osd_perf_counters() might return None, add assert() to assure
mypy that it does not return None here.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
2a5a50f3ba pybind/mgr/cephadm/serve: add assert to appease mypy
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
2fd0a03192 pybind/mgr/cephadm/module: assure self.ssh_user is not None
to appease mypy

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
cb3a50cd36 pybind/mgr/cephadm/inventory: cast variable to expected type
to silence mypy warnings like:

cephadm/module.py:55: note: In module imported here,
cephadm/__init__.py:6: note: ... from here:
cephadm/inventory.py: note: In member "load" of class "SpecStore":
cephadm/inventory.py:130: error: Invalid index type "str" for "str"; expected type "Union[int, slice]"
cephadm/inventory.py:131: error: Invalid index type "str" for "str"; expected type "Union[int, slice]"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
cb2de05a39 tools/setup-virtualenv.sh: do not pass --use-feature=2020-resolver to pip
pip use the new resolver by default now. so no need to pass this option
to it anymore.

This reverts commit fa9e2bfd4b.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
00f5a80201 pybind/mgr/mgr_module: annotate variable type
to silence following mypy error:

cephadm/module.py:1155: error: Incompatible types in assignment
(expression has type "None", variable has type "str")

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
53415832cd pybind/mgr/cephadm: rename variables to avoid name reuse
to applease mypy, otherwise, for instance, "err" would be reused for
holding the return value of self.mgr.check_mon_command(...)

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
eb6603f1b5 pybind/mgr: annotate OSDMap and friends
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
7b2dd7eba4 pybind/mgr: correct annotation for BasePyOSDMap._apply_incremental()
it's incorrect. as the underlying C implementation,
"osdmap_apply_incremental()", actually expects an instance of
`BasePyOSDMapIncrementalType`. which is mapped to
`BasePyOSDMapIncremental` in Python. and this class is wrapped using
`OSDMapIncremental` in mgr_module.py.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
d139166ea7 pybind/mgr: define HandleCommandResult using NamedTuple
simpler this way, so we don't need to define __new__

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
ab0243b319 pybind/mgr: use numeric values of logging level for index
less magic values in code this way

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
6c3d817435 mgr/cephadm: use dict instead of defaultdict to silence mypy warning
otherwise we have:

1: cephadm/module.py:30: note: In module imported here:
1: cephadm/serve.py: note: In member "_check_for_strays" of class "CephadmServe":
1: cephadm/serve.py:395: error: Argument "default" to "get_metadata" of "MgrModule" has incompatible type "defaultdict[str, None]"; expected "Optional[Dict[str, str]]"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
5272748e17 mgr/rook: handle the case where given osd is not found
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:02:24 +08:00
Kefu Chai
2d20390b17 mgr/dashboard: pass str as the 2nd param of set_store()
MgrModule.set_store() only accepts str or None as its second
parameter.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
6cdbe8f9e8 mgr/progress: pass a str as the value of option to set_module_option()
MgrModule.set_module_option() only accepts str or None as its second
parameter.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
1268f36f2b mgr/progress: pass id to constructor of Event
to assure that the self.id is always valid, it helps to silence the
warnings from mypy like:

progress/module.py: note: In member "_refresh" of class "Event":
progress/module.py:46: error: Argument 1 to "update_progress_event" of "MgrModule" has incompatible type "Optional[str]"; expected "str"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
dee8474474 pybind/mgr/insights: be PEP8 compliant
to applease flake8

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
352cd2d461 pybind/mgr/insights: use CLICommand to define command
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
3422ba1bfc pybind/mgr/iostat: minor cleanups
* do not pass typename and self to super()
* do not add parentheses around condition expression

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
4ffcccf6a4 pybind/mgr/iostat: use correct types
for better readability and for the sake of correctness.

* do not cast denominator to float before diving by it
* use '//' for divding an int
* cast int to str as it will be used as an element in a list of str

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
9bcd08c375 mgr/iostat: use CLICommand to define command
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00
Kefu Chai
8da98e55b9 pybind/mgr/mgr_module: annotate more methods
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-26 18:01:59 +08:00