18 Commits

Author SHA1 Message Date
Akihiro Motoki
f3e9ef5851 extract_messages, update_catalog: Simplify help message
Previously the help message of update_catalog shows all available
languages in the command example. It is difficult to understand
what an exact command line is expected.
This commit uses metavar to simplify the brief command line
and shows available languages in the help text.

Similar change is made to 'domain' argument of update_catalog
and of extract_messages.

Also the default values are added in the help message.

Change-Id: I63efea7e368eb1dfaf203ca4c515eb57173b571e
2017-08-29 12:35:30 +00:00
Jenkins
c8c31e9f54 Merge "Fix pofile for pseudo translations" 2017-08-21 10:10:02 +00:00
Nick Timkovich
846fc19d71 Fix pofile for pseudo translations
The pofile name in the pseudo translation logic appears to expect the
babel.messages object, not the string holding the location of the pofile.

Trimmed a string that gettext reacts poorly with when creating pseudo-
translations.

Change-Id: I811711412d85a989826a946d1d57ed39790e34ed
Closes-Bug: 1710003
2017-08-15 13:14:15 -05:00
Akihiro Motoki
19a4012b91 extract_messages: Specify input directory
Currently horizon/locale/{django,djangojs}.js contain strings from
openstack_dashboard and vice versa. To avoid this, --input-dirs
option needs to be passed to python setup.py extract_messages.

Change-Id: Iee874616f4c037cc68bc3b0c7d8586d86f7153f4
Closes-Bug: #1710396
2017-08-12 17:52:31 +00:00
Radomir Dopieralski
d9e4b6ae68 Use WSGIApplicationGroup %{GLOBAL} in mod_wsgi configuration
Change-Id: I0633703cef5a225fe8b689017d21aa4f45ecc7cf
Closes-bug: #1708655
2017-08-04 14:52:43 +02:00
Akihiro Motoki
e6b78f92f2 Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
This flake8 plugin is already used in tempest.
It enforces loose checking so it sounds good to use.

Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.

Change-Id: I8ccd05eb70350a2441cc2a4d1eafc09ee690b83b
2017-07-03 08:02:23 +00:00
Akihiro Motoki
baa4ca8dce hacking: noqa cleanup in openstack_dashboard
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.

After this, there are only 3 noqa under openstack_dashboard/ :)

Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
2017-03-17 19:38:47 +00:00
Radomir Dopieralski
c3b6fc761e Make extract_messages quiet in pep8 test
The additional extract_messages call in the pep8 tox environment
generates a lot of meaningless output, that then makes it difficult
to spot actual failures and warnings. This patch makes the Django
command respect the verbosity setting and call the setup.py command
with a quiet flag if low verbosity is requested, considerably decreasing
the amount of useless output. It then sets that verbosity to low in the
corresponding tox environment.

Change-Id: I2976250a23e800fbb582726299670b57199b58a7
2017-03-17 16:55:18 +01:00
Yves-Gwenael Bourhis
600620a8d5 Configuring number of apache processes
By default apache spawns only one process for the wsgi app if not specified.
This patch detects the number of CPUS to configure n CPUs +1 processes by
default and allows to specify the number of processes explicitly.

Change-Id: I684ecd15193cef169d7a86f66a47b7d1d76c1c24
Closes-Bug: #1658048
2017-01-20 11:49:34 +01:00
Cao Xuan Hoang
f0dc5c3614 Removes unnecessary utf-8 encoding
trivialfix

Change-Id: Ia9b35ab6c39cc35c0c3e2b0ebb95930314df43b6
2016-12-13 15:22:09 +07:00
Rob Cresswell
36d1d1ac68 Refactor tox & update docs
- Updated tox envlist, so just running `tox` from the CLI will now run all
voting gate tests

- Reduce duplicated definitions and commands

- Remove any reliance on run_tests within tox

- Removes all doc references to run_tests.sh, and replaces them
with their tox equivalent. Where necessary, language around the tox
commands has been altered or extended so that it makes sense and is
consistent with other parts of the docs. Also adds a new "Test Environment"
list to the docs, so that newcomers do not have to piece together CLI
commands and their cryptic extensions from tox.ini

- Move the inline shell scripting to its own file. Also fixes a bug when
passing args, since the logic assumed you were attempting a subset test
run (try `tox -e py27 -- --pdb` on master to compare)

- Moved translation tooling from run_tests to manage.py, w/ help text
and arg restrictions. This is much more flexible so that plugins can use
it without having to copy commands, but still defaults to exactly the
same parameters/behaviour from run_tests. Docs updated appropriately.

- Removed npm/karma strange reliance on either .venv or tox/py27. Now
it only uses tox/npm.

Change-Id: I883f885bd424955d39ddcfde5ba396a88cfc041e
Implements: blueprint enhance-tox
Closes-Bug: 1638672
2016-11-30 20:38:59 +00:00
Ivan Udovichenko
374e60307d Use argparse instead of optparse
Use of optparse module is deprecated [1] in Django 1.8 and 1.9 versions and
its support has been removed in currently developed version 1.10 [2]

[1] https://docs.djangoproject.com/en/1.9/howto/custom-management-commands/#django.core.management.BaseCommand.option_list
[2] 6a70cb5397 (diff-dfc45ab8548a0777543d12d6e77c9173)

Change-Id: I0c7622fce0d5fabce45366d002b5e72e4c170344
2016-08-09 09:00:21 +03:00
Yves-Gwenael Bourhis
f9e864c9fc Update WSGI app creation to be compatible with Django 1.7 or greater
This resolves the following error when trying to run Horizon if it has
been installed via "django-admin make_web_conf --wgi":

AppRegistryNotReady: The translation infrastructure cannot be
initialized before the apps registry is ready. Check that you don't
make non-lazy gettext calls at import time.

and is backwards-compatible with our currently supported versions.

Closes-Bug: #1497986
Change-Id: I643058bb82f8e0f11b38ce0dd046773e91e053c3
2015-09-21 15:36:19 +02:00
Yves-Gwenael Bourhis
42bc31b386 Detect apache version
We try to detect apache's version.
Some distributions do not allow launching apache commands (even for detection)
if not root, so we gracefully fall back on 2.4 version configuration file
We alse add an --apache-version option to force the version in case
detection would be wrong.

Closes Bug: #1438773

Change-Id: I7d28c319601cf3919068be4ac52dd10f58a82557
2015-04-03 09:51:05 +02:00
Diego Garcia del Rio
df8ffbd357 spelling mistakes on display outputs and docsstrings
Change-Id: Ic594db332c89e44293f4018e31d3fb47f69e7029
2015-02-24 20:00:03 -08:00
Yves-Gwenael Bourhis
9610f0bed0 Added a migrate_settings command
This command allows to easily save a diff between local_settings.py and
local_settings.py.example to reapply the change when local_settings.py.example
changes (per branch switch or updates).

implements bp settings-migration-script

Change-Id: I2668bbf248434a5d437a5fc46ad07c1a1f29b793
2015-02-05 12:24:18 +01:00
Akihiro Motoki
832a741c88 Fix E128 errors in remaining openstack_dashboard/
E128 continuation line under-indented for visual indent

Closes-Bug: #1375929
Change-Id: I2a72313d359bdfe2e2667eba5d3bf9744ec8f60a
2014-10-16 16:53:52 +09:00
Yves-Gwenael Bourhis
c2d9a373c1 Created a make_web_conf command.
The current wsgi does not support virtualenvs (in some distributions, the
dependencies may conflict with the distribution's python packages/dependencies
and would require a virtualenv even in production).
Also, making an apache web configuration is not always trivial especialy
with ssl.
This "make_web_conf" command creates a wsgi with automatic virtualenvironment
detection (if there is a virtualenvironment), and creates an apache
(normal or ssl) configuration

TODO(ygbo)::

    - add nginx support to generate nginx configuration files.
    - add gunicorn support.
    - add uwsgi support.

implements bp web-conf-generation-script

Change-Id: I6397ba01df88b540bbdca4bf21ba90be6843022a
2014-04-03 17:34:32 +02:00