fix(helpers.py): use keyword args for ensure_daemon/restart_daemon#414
Open
sduke1848 wants to merge 1 commit into
Open
fix(helpers.py): use keyword args for ensure_daemon/restart_daemon#414sduke1848 wants to merge 1 commit into
sduke1848 wants to merge 1 commit into
Conversation
The wrapper functions ensure_daemon() and restart_daemon() in helpers.py were passing the BU_NAME value as a positional argument to admin.ensure_daemon(wait, name, env), causing TypeError: unsupported operand type(s) for +: 'float' and 'str' Fix: pass name= as a keyword argument so it lands in the correct parameter. Also adds start_remote_daemon() and stop_remote_daemon() wrappers for completeness.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
The wrapper functions
ensure_daemon()andrestart_daemon()inhelpers.pypass theBU_NAMEvalue as a positional argument toadmin.ensure_daemon(wait, name, env):Since
waitis the first parameter (typefloat), passing a string name causes:Fix
Pass
name=as a keyword argument so it lands in the correct parameter:Also adds
start_remote_daemon()andstop_remote_daemon()wrappers for completeness.Testing
After fix:
Summary by cubic
Fixes a crash when starting or restarting the daemon by passing the
namekeyword instead of a positional arg. Also adds wrappers to start and stop a remote daemon.Bug Fixes
ensure_daemon()andrestart_daemon()now passname=...toadmin.*, preventing a TypeError inadmin.ensure_daemon(wait, name, env).New Features
start_remote_daemon(name=None, **kwargs)andstop_remote_daemon(name=None)helpers.Written for commit 42a4d07. Summary will update on new commits.