130 Commits

Author SHA1 Message Date
Julie Pichon
065786c745 Import is_service_enabled from module
An additional step for H302, and needed here to make mocking
is_service_enabled across modules more consistent and easier
(e.g. mocking only one signature as opposed to both
api.base.is_service_enabled and quotas.is_service_enabled).

Partial-Bug: #1109140

Change-Id: Ie6cec3138de6f2fc57b68e90db45f53bb94ab87d
2013-08-27 19:13:10 +01:00
Jenkins
8b8ab049bc Merge "Small "H302 check" cleanup" 2013-08-27 19:10:51 +00:00
Julie Pichon
fde88906b3 Show Neutron floating IPs quotas on Overview
Display the correct limits and usage when Neutron is in use and the
quotas extension is enabled. If Neutron is enabled but the quotas
extensions is not supported, assume the floating IPs quota is
unlimited (a floating IP quota is expected to exist in other places,
e.g. Security and Access panel)

Because quotas may not be configured or enabled even if the extension
is available, add an 'enable_quotas' setting.

Partial-Bug: #1109140

Change-Id: Id6345f4700f0ff45be8ce8acb69cca0d4e05e14a
2013-08-26 16:39:27 +01:00
Tatiana Mazur
b4fc9b4bc9 Small "H302 check" cleanup
This patch set removes some commented out stuff that
has been unintentially left in "H302 check" patch set.
It also replaces a couple more method imports with
module imports.

Fixes bug 1215892

Change-Id: I35fd880154a4ea6d6d8d3b3615103c271aa4a005
2013-08-23 18:07:08 +04:00
Tatiana Mazur
953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Kieran Spear
242c8df495 Enable H201: do not write "except:"
Fixes all occurrences of this. We have a custom exception handler
in Horizon anyway that only catches ClientException in most of these
cases, but this commit lets us gate on the other cases.

Change-Id: Iea3dc13817f3e5b775b2024424bf3a906da5584b
Closes-Bug: #1211657
2013-08-13 17:21:32 +10:00
Victoria Martinez de la Cruz
142a6e97fe Query a period of time for usage summary
Allows the user to pick a range of time
to query services usage data.

Fallback mode: the user will have to input
dates by hand if JavaScript is disabled.

Change-Id: I4cf4d4fd56fd450743b9d624dc066d6ed74df881
Fixes: bug #1102448
2013-07-25 09:50:42 -03:00
Sergey Lukjanov
59ef565871 Enable H306 check
H306  imports not in alphabetical order

Change-Id: Ief2accac748248ebf46d4e49230662ff9b233053
2013-07-02 11:38:27 +04:00
Tihomir Trifonov
0c0153a037 Improvements in csv export for usage data
Added a csv writer using the 'csv' library to format
properly exported data - escaping, encoding etc.
Added a HttpResponse-based class to handle csv generation
Added translation for the CSV columns and template.

Fix bug #1158383

Renamed few occurencies of 'tenant' to 'project'.

Also added a new 'project' in nova_data.py, which required
some refactoring of few tests, that didn't consider the current project
for project-based calls.

Note: I've added a StreamingHttpResponse example,
which is introduced in Django 1.5+ and being advised in the ticket.
However, my opinion is that at the moment we don't need this - it is
too complicated for the current usage.

Change-Id: I18bd70a23b7b8389c7c0f96dbf8794fea5e1e75b
2013-06-21 14:00:37 +03:00
Matthias Runge
cea720e793 Sort imports alphabetically
This patch also re-organizes imports to import one per line.

Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
2013-06-14 12:05:55 +02:00
Matthias Runge
4ac70a732a remove unused imports
In the move to make flake8 tests stricter, we need a code
cleanup earlier.
This removes all unused imports and also enables tests to prevent
them for the future.

This patch also includes the checks on __init__.py files.

Change-Id: I34055803f7c4726682ac6fb95cc5b50ba761fec8
Fixes: bug 1188134
2013-06-13 07:51:10 +02:00
Eric Peterson
d4b0ab4aa3 switching to use limits instead of quotas
Fixes bug 1178694

Change-Id: I6fad061faf84079492338016fd2bada9a2e434f3
2013-06-05 15:40:37 -06:00
Jan Provaznik
ea1edcb027 Enable snapshot quota setting
Change-Id: Ie8bcd2d2fddf717a29328bc802a2fda80198183b
Fixes: bug #1177249
2013-05-27 14:22:38 +02:00
Kieran Spear
ef26414b8d Revert "Improvements in csv export for usage data"
This reverts commit a4e583cffbd2dbe2e431c306c389a0b0815073e1

Fixes bug 1183441, bug 1183230, bug 1183310.
2013-05-23 16:50:57 +00:00
Tihomir Trifonov
a4e583cffb Improvements in csv export for usage data
Added a csv writer using the 'csv' library to format
properly exported data - escaping, encoding etc.
Added a HttpResponse-based class to handle csv generation
Added translation for the CSV columns and template.
Improved consistency for exported data - now passing project name
instead of project id for csv export. Also added both project name/id
in the header of a project usage export.

Fix bug #1158383

Renamed few occurencies of 'tenant' to project.

Also added a new 'project' in nova_data.py, which required
some refactoring of few tests, that didn't consider the current project
for project-based calls.

Note: I've added a StreamingHttpResponse example,
which is introduced in Django 1.5+ and  being advised in the ticket.
However, my opinion is that at the moment we don't need this - it is
too complicated for the current usage.

Change-Id: Ic00626b273921fa5c6c89704b3a9e08b252aaeb0
2013-05-22 11:09:49 +03:00
Brooklyn Chen
08e6ed7392 Use ugettext_lazy instead of ugettext.
We should use ugettext_lazy to let users in different languages
get correct translation.Though in views or similar places
we can use ugettext with no problems, we should make code
style consistent.

This also fix the issues that the django proxy objects appear on the
launching instance page instead of translated strings. Now the
translated quota strings are handled correctly.

Fixes: bug #1178722

Change-Id: I76f0d31e6546d70e5ece7e86a06f7eefd04861d2
2013-05-18 15:13:54 +08:00
David Lyle
81247fda00 Adding pagination to the instance views
Modifying the api.nova.server_list() method to optionally handle
pagination.  The method will also work without pagination to
support the many other place than the instance views that continue
to call the method.

Fixes: bug #1046915

Change-Id: I8195f1f2d8922e1722743d7a2d627a8645e8b3bd
2013-04-11 21:24:01 -06:00
Julie Pichon
d5f2dc38e6 Allow admin to edit project quotas for fixed IPs
Fixes bug #1157950

Change-Id: If8bf548f66ff13b2b5218ca6c1e8c69c054e0a59
2013-03-26 17:58:01 +00:00
Kieran Spear
1935a3d8d2 Check if volume service is enabled in quota update
Quotas fail to load on the project quota update form in the
admin dashboard when the volume service is disabled.

Change the get_default_quota_data and get_tenant_quota_data functions
to always check for a disabled volume service, so we don't have to
remember to do it every time we call the functions.

Moved *QUOTA_FIELDS to usage/quotas.py to avoid a circular import.

Fixes bug #1155878.

Change-Id: I7150c4d7c318b6199ff03825cf5d770c7741b379
2013-03-19 12:06:16 +11:00
Wu Wenxiang
e765f4e588 Reduce duplicate definitions about quota sets
Use unified definitions of "quota sets" instead of dispersed
    duplicated definitions.

Change-Id: I7de5bd77d187e7353c154ea89a8b259c309f0faa
2013-03-18 22:06:20 +08:00
Wu Wenxiang
38d5b60aa8 Correct the related tenant_id when getting quotas
QuotaUsage::_get_quota_data() always get the project quotas by the
requester's tenant_id, which was wrong.

Add a args "tenant_id" which point to the correct project when
getting its quotas.

Fix Bug #1130070

Change-Id: I82f080720235631c430d8a18a44ece013de60a3b
2013-03-16 15:54:42 +08:00
Akihiro MOTOKI
dbfcc97e89 Quantum Floating IP support
blueprint quantum-floating-ip

This commit allows OpenStack dashboard users to use Quantum floating
IP feature directly using Quantum API rather than Nova Proxy.
By this users can associates a floating IP per virtual NIC.

blueprint nova-net-quantum-abstraction

This commit defines an abstract class in api/network.py.
This class provides common interfaces related to network features
duplicated in Nova and Quantum. A concrete class to handle operations
should be defined in api/nova.py or api/quantum.py.

Change-Id: I780356a9f41e72e32ce1877d390ac7f99e96899c
2013-01-30 20:38:35 +09:00
Akihiro MOTOKI
12faaa5c30 Ensure to use api.<category>.<method>
In the current code both api.<method> and api.<category>.<method> are used.
Using api.<method> directly makes it difficult to identify which module
defined a method and forces developers to use unique method names among
projects. This commit removes api.<method> style method calls.

Change-Id: Iaefa1061f99b7865e02541df87c112a6b2868ec0
2013-01-22 20:37:12 +09:00
Victoria Martínez de la Cruz
aec73a78b2 Add a check for unlimited quotas
This extra check will prevent Horizon to misunderstand "-1" value when tallying quotas,
setting the "Available" field to inf instead of 0.

Fixes: bug #1084976
Change-Id: Ib316a15ac8ffa8ed4e4c51c02d5956db57fb6f6e
2012-12-05 16:34:20 -03:00
Julie Pichon
300747c9a3 Make sure vCPU and RAM quotas are initialised when no instances are running
Fixes bug 1084609

Change-Id: Ia89c2071e8366912f97bc7c3a63caccc26430e53
2012-11-29 21:11:45 +00:00
Tihomir Trifonov
4c88b9b597 Added a check for volume service in quota functions
When displaying the quotas, we have to check if
volume service is present in the service catalog.
If not - then to remove the volume quotas from
the result object.

Fixes bug 1075319

Change-Id: Icd049a5b147cac039add1570a166d775fd0d6ec4
2012-11-09 15:00:30 +02:00
Jenkins
7e132e385a Merge "Enable quota data from multiple sources." 2012-10-24 21:51:38 +00:00
Gabriel Hurley
cdcd8e3df6 Enable quota data from multiple sources.
Now that there are multiple projects with quota data (cinder, quantum)
we need to accommodate that data being aggregated in a centralized
fashion. This commit takes care of that for nova + cinder, and paves
the way for quantum later.

Fixes bug 1070022.

Change-Id: Ifc68c2dc681b2a7b4e7787e0b1a7dca1a970fc36
2012-10-24 12:53:42 -07:00
Tihomir Trifonov
811ee7b58a Fixed url pattern for project:instances:detail page
Removed obsolete :nova: namespace

Fixes bug 1070230

Change-Id: Ia56ef9ebf1a9bfe90b02491125821742ee840baa
2012-10-23 11:33:32 +03:00
Gabriel Hurley
cb8e7c1f8f Splits OpenStack Dashboard bits from framework app code.
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.

Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b
2012-10-11 11:47:50 -07:00