[PATCH v2 09/10] parsemail: Convert to a management command
Andy Doan
andy.doan at linaro.org
Tue Aug 23 13:35:58 AEST 2016
On 08/21/2016 01:09 PM, Stephen Finucane wrote:
> From: Stephen Finucane <stephen.finucane at intel.com>
>
> Management comands allow applications to register their own actions with
> 'manage.py'. This provides some advantages, like automatically
> configuring Django (removing the need for 'django.setup' calls) and
> removing the need to set the PYTHON_PATH. The 'parsemail' script is a
> natural fit for this type of application. Migrate 'parsemail' to a
> management command.
>
> This includes some extensive work on logging configuration, as logging
> is moved from code into settings. In addition, it removes a lot of the
> customizable logging previously introduced in the parsemail command, in
> favour of modifications to the settings files.
>
> Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
> Partial-bug: #17
> Closes-bug: #15
One question, but I'm basically +1:
> diff --git a/patchwork/bin/parsemail.sh b/patchwork/bin/parsemail.sh
> index 9973392..85a21a1 100755
> --- a/patchwork/bin/parsemail.sh
> +++ b/patchwork/bin/parsemail.sh
> @@ -24,6 +24,8 @@ PATCHWORK_BASE=`readlink -e $BIN_DIR/../..`
>
> PYTHONPATH="$PATCHWORK_BASE":"$PATCHWORK_BASE/lib/python:$PYTHONPATH" \
> DJANGO_SETTINGS_MODULE=patchwork.settings.production \
> - "$PATCHWORK_BASE/patchwork/bin/parsemail.py"
> + "$PATCHWORK_BASE/patchwork/manage.py parsemail"
>
> +# NOTE(stephenfin): We must return 0 here. For more information, refer
> +# to https://patchwork.ozlabs.org/patch/602248/
> exit 0
This makes sense, but I'm still confused why you don't pass $* to the
command since it can take "--list-id" as an option?
More information about the Patchwork
mailing list