Merge branch 'rc/maintenance' into maintenance

This commit is contained in:
Gina Häußge 2017-01-20 16:28:42 +01:00
commit e20fcd9ce5
2 changed files with 17 additions and 3 deletions

View file

@ -1,5 +1,13 @@
# OctoPrint Changelog
## 1.3.1rc2 (2017-01-20)
### Bug fixes
* [#1641](https://github.com/foosel/OctoPrint/issues/1641) - Fix issue with `octoprint --daemon` not working. (2nd try)
([Commits](https://github.com/foosel/OctoPrint/compare/1.3.1rc1...1.3.1rc2))
## 1.3.1rc1 (2017-01-13)
### Note for upgraders

View file

@ -55,6 +55,8 @@ def set_ctx_obj_option(ctx, param, value):
ctx.obj = OctoPrintContext()
if value != param.default:
setattr(ctx.obj, param.name, value)
elif param.default is not None:
setattr(ctx.obj, param.name, param.default)
#~~ helper for retrieving context options
@ -139,7 +141,7 @@ from .config import config_commands
@legacy_options
@click.version_option(version=octoprint.__version__, allow_from_autoenv=False)
@click.pass_context
def octo(ctx, debug, host, port, logging, daemon, pid, allow_root):
def octo(ctx, **kwargs):
if ctx.invoked_subcommand is None:
# We have to support calling the octoprint command without any
@ -148,16 +150,20 @@ def octo(ctx, debug, host, port, logging, daemon, pid, allow_root):
# But better print a message to inform people that they should
# use the sub commands instead.
def get_value(key):
return get_ctx_obj_option(ctx, key, kwargs.get(key))
daemon = get_value("daemon")
if daemon:
click.echo("Daemon operation via \"octoprint --daemon "
"start|stop|restart\" is deprecated, please use "
"\"octoprint daemon start|stop|restart\" from now on")
from octoprint.cli.server import daemon_command
ctx.invoke(daemon_command, debug=debug, host=host, port=port, logging=logging, allow_root=allow_root, command=daemon, pid=pid)
ctx.invoke(daemon_command, command=daemon, **kwargs)
else:
click.echo("Starting the server via \"octoprint\" is deprecated, "
"please use \"octoprint serve\" from now on.")
from octoprint.cli.server import serve_command
ctx.invoke(serve_command, debug=debug, host=host, port=port, logging=logging, allow_root=allow_root)
ctx.invoke(serve_command, **kwargs)