Skip to content

mgr/orchestrator: set lsm_data to default of Dict type#37644

Merged
jschmid1 merged 1 commit intoceph:masterfrom
mgfritch:orch-device-lsm_data
Oct 19, 2020
Merged

mgr/orchestrator: set lsm_data to default of Dict type#37644
jschmid1 merged 1 commit intoceph:masterfrom
mgfritch:orch-device-lsm_data

Conversation

@mgfritch
Copy link
Contributor

similar to handling of sys_api, convert a NoneType to a Dict

Fixes: https://tracker.ceph.com/issues/47841
Signed-off-by: Michael Fritch mfritch@suse.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@mgfritch mgfritch requested review from jan--f and pcuzner October 13, 2020 01:02
@mgfritch mgfritch requested a review from a team as a code owner October 13, 2020 01:02
similar to handling of `sys_api`, convert a NoneType to a Dict

Fixes: https://tracker.ceph.com/issues/47841
Signed-off-by: Michael Fritch <mfritch@suse.com>
Copy link
Contributor

@jan--f jan--f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit pick to simplify a minute amount, but otherwise lgtm

lvs=None, # type: Optional[List[str]]
device_id=None, # type: Optional[str]
lsm_data={}, # type: Dict[str, Dict[str, str]]
lsm_data=None, # type: Optional[Dict[str, Dict[str, str]]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nit pick for sure, but wouldn't it make sense to keep lsm_data={} if only for being able to drop Optional[] from the type signature? I don't see how this can ever be None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to avoid using a mutable default? The NoneType value was caused by going between subinterpreters ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants