Repository navigation
cephadm: use importlib.metadata for querying ceph_iscsi's version - #57685
Conversation
1a35ec9 to
c246b9a
Compare
There was a problem hiding this comment.
Good idea, but I think that it should be a file level function, as there's very little need for it to be a closure. Something like:
def _python(engine: str, container_id: str, src: str) -> Tuple[str, str, int]:
...
There was a problem hiding this comment.
the whole point of creating this helper is to make the caller's life easier, and to reduce the number of parameters, and less repeatings. the reason why i made it a nested function was that it was not supposed to be shared across other functions. and i wanted to make it very clear. but yes, it does not have to be a closure.
i am moving it to a . hmm, i changed accordingly. now i feel bad when reading the new revision. do you insist? if not, i'd keep this way. otherwise i will push the new revision.staticmethod, hope this helps.
There was a problem hiding this comment.
I don't insist. I typically find standalone functions easier to read and reason about, but I won't demand it in this case.
c5566f0 to
2c90dc1
Compare
|
v2:
|
to prepare for a change to use importlib, then fallback to pkg_resources. as the former is only available in Python 3.8, while the latter is deprecated. Refs https://tracker.ceph.com/issues/66201 Signed-off-by: Kefu Chai <[email protected]>
use importlib.metadata for querying ceph_iscsi's version and fallback to pkg_resources. as the former is only available in Python 3.8, while the latter is deprecated. Refs https://tracker.ceph.com/issues/66201 Signed-off-by: Kefu Chai <[email protected]>
2c90dc1 to
cbd4bed
Compare
|
jenkins test api |
|
failures consisted of
Nothing to block merging for most PRs in the run |
use importlib.metadata for querying ceph_iscsi's version and fallback to pkg_resources. as the former is only available in Python 3.8, while the latter is deprecated. Refs https://tracker.ceph.com/issues/66201 This commit is functionally equivalent to a Reef-targeted backport of ceph#57685. Signed-off-by: Zac Dover <[email protected]>
use importlib.metadata for querying ceph_iscsi's version and fallback to
pkg_resources. as the former is only available in Python 3.8, while
the latter is deprecated.
Refs https://tracker.ceph.com/issues/66201
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e