This commit relocates test codes in openstack_dashboard
according to blueprint relocation-test-codes.
Change-Id: I397a5a47fe9c1bf3a498c22056d924bf409c514b
A patch of MKS console support replaces 'console' key into
'remote_console', but 'remote_console' key is only available
in Nova API version 2.6 or later. Horizon uses Nova API version
2.1 by default, so this change breaks the existing server console
support completely. This patch fixes it.
Change-Id: I656037511e0d80688df4b82fa8c77fe5c09402bd
Closes-Bug: #1735436
Nova server_list() wrapper needs to receive an explicit `all_tenants`
boolean flag in order to request instances for _all_ tenants -
otherwise while rendering Admin->Volumes table Django will request
missing instances (to get their names for volume attachments) one by
one, thus significantly increasing response time.
This patch adds check if all_tenants in search_opts and add it to
the search else uses tenant_id in the search_opts.
Co-Authored-By: Dmitry Sutyagin <dsutyagin@mirantis.com>
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Change-Id: I4761d7da15036b69619649871aef91e1799ee385
Closes-Bug: #1508568
Added a column to show the locked status on project/admin instances table.
There will be a locked or unlocked icon with help tooltip if nova 2.9 or
above is used. See openstack_dashboard/api/microversions.py
Added the locked field on project/admin instance details panel.
Change-Id: If31ae281d2782c71cd6112f3bd6228647a6130e4
Closes-bug: #1593903
Ref£º http://docs.openstack.org/developer/hacking/#real-world-import-order-examples
[H203] Use assertIs(Not)None to check for None (off by default) Unit test assertions
tend to give better messages for more specific assertions. As a result,
assertIsNone(...) is preferred over assertEqual(None, ...) and assertIs(None, ...),
and assertIsNotNone(...) is preferred over assertNotEqual(None, ...)
and assertIsNot(None, ...).
Change-Id: I84b3304cae4284bdbad7d093cb6fa1d3d303ee52
Updated the nova api to return None when the image name
is not available, for example, when it's deleted.
Added a check for the image name before showing it as
a link.
Change-Id: I342b23dfd8352182f50c41054d2dbb3eae854839
Closes-bug:1668783
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
Always try to request and use version 2.40 of the nova api for that
particular call, so that we can use pagination.
Change-Id: I5890776bb273f6dd20807dc0d315f4c67785fcc4
Stitches back together all the pages for the os-simple-tenant-usage
call, so that the usage statistics are complete.
Implements blueprint paginate-simple-tenant-usage
Depends-on: If99db6933de012b71cf2c982075f08b3e664361e
Change-Id: I8c1206807f707ef47dd92e3cb663970804e3ec8e
As mentioned in [1], we should avoid using six.iteritems(iter) to
achieve iterators. We can use iter.items() instead, as it will
return iterators in PY3 as well.
[1] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Change-Id: Ieadd5fa69b3f6058c0641a5b96ef3e8e1e3f6cc2
Some tests used incorrect order assertEqual(observed, expected).
The correct order expected by testtools is
assertEqual(expected, observed).
Change-Id: I83b7009f9b32f4abc88c23cafbe293b65dc25fb4
Partial-Bug: #1259292
The request parameter is a django.http.HttpRequest instance object
which contains metadata about the request. This object is a new instance of
django.http.HttpRequest in every view, so memoizing with it memoizes during the
rendering of a single view only, thus preventing multiple api calls only
during the rendering of one view.
Some nova api memoized methods should memoize more persistantly with objects
which do not change after the rendering of each view, like the list of
extensions suported.
However, it is still a good idea to limit memoization of some api calls during
the rendering of a single view, if the query is subject to give different
results (i.e., the flavor_list can change when an administrator adds a flavor
so we need to retreive new data for each view in case a flavor gets added by a
cloud admin).
Implements blueprint: improve-horizon-caching
Co-Authored-By: Daniel Castellanos <luis.daniel.castellanos@intel.com>
Change-Id: I9f87df72cbf149e7b2d1763d7976cb845b1e98f9
Allow users to choose a server group when booting a VM. Adds
a dropdown list to select a server group to the Launch Instance
workflow.
Change-Id: I0b0d5ec79841da3da569bd22c533fdbf76002c96
Partially-Implements: blueprint nova-server-groups
When runing the "./run_tests.sh -c" command,
and after looking at the reports, not all the code is covered
by the unit tests.
The code related to Flavors in the openstack_dashboard/api/nova.py
(get flavor list, create flavor, delete flavor, etc) is not covered.
Change-Id: Idf32b22cde2925b830d85ba9c675fa0e88a2eb0e
Closes-Bug:#1558758
This adds the Update Metadata action to the instances table to allow
managing the metadata on an instance. This is very similar to the
Update Metadata actions for images, flavors, etc.
Implements: blueprint edit-server-metadata
Change-Id: Ia09a05f5cd93898ec9d64ac7af1e6baf07e71757
When loading the instances page, the glance service is used as a
fallback to obtain the image name for each instance. This patch adds
tolerance for an unconfigured glance service endpoint for the current
region so that the page will still load.
Change-Id: Ia512269ae4b069db85a1f13530856b9c7beafee3
Closes-Bug: #1361298
mox doesn't work on Python 3, whereas mox3 works on Python 2 and Python
3. Cinder, Nova and many other projects already replaced mox with mox3.
mox3 is now maintained by OpenStack.
Partial-Implements: blueprint porting-python3
Change-Id: I10e6a9754ebd58a2640d73ec8966527c3aa1fe9a
This patch adds migrate capability to Horizon for host
already marked for maintenance.
All instances could be cold migrated.
There is an option also for running instance to allow
making live migration to them.
All running instances will be migrated as the same
migrating configuration, if the administrator wants to
migrate a specific instance in a specific configuration he
could do it from the instance dashboard.
blueprint migrate-all-instances-from-hosts-in-maintenance-mode
Change-Id: Ia1260831e79ede66a9d4320b092bebeb023796bc
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
E127 continuation line over-indented for visual indent
Also fixes E127 introduces by other reviews
after other E127 fixes were merged.
Closes-Bug: #1375931
Change-Id: I0a09f1c2f74c707fc8a347f0ea5975bf2679976e
Due to bug 1370867 there is a case where negative values are returned
in total*Used in absolute_limits. If it occurs, Horizon Overview page
cannot be displayed due to an error "cannot convert float infinity to
integer". This commit replaces negative values in total*Used with 0
for a workarond.
Change-Id: I606803bdff1d335cc9f92d67619ff82f356a5143
Closes-Bug: #1370869
Some tests used incorrect order assertEqual(observed, expected).
The correct order expected by testtools is
assertEqual(expected, observed).
Change-Id: Iabf6e55146412b57b6a6544f312f9510f762566a
Partial-Bug: #1259292
According to https://wiki.openstack.org/wiki/Python3 dict.iteritems()
should be replaced with six.iteritems(dict).
Change-Id: Ia2dcabbd071e1fcdf111ba83573785989a77aef0
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
Hyper-V employs RDP to access virtual machine consoles, unlike most
other hypervisors which support VNC.
In order to support this scenario, the get_rdp_console API has been
added to Nova. This commit adds the corresponding UI feature,
implemented in a way consistent with existing VNC and SPICE console
support.
Change-Id: I9722a1aef5d26184f5a6bc278e306acbdae76b7b
Blueprint: hyper-v-rdp-console
This patch set removes leftovers of "# noqa" from imports
added to import_exceptions.
It also adds "django.test.utils.override_settings" to
import_exceptions, so a few more "# noqa" tags become
unnecessary.
Closes-Bug: #1273647
Change-Id: I39f856ac3ea371a2fcab272bbf358d0243164b6d
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
- Don't import nova client directly in a panel, client details should
only live in openstack_dashboard/api
- "allowed()" now checks if instances is None, which can happen with
BatchActions
- Remove unused reboot() method from Server
- Fix import order for 'logging' module
Fixes: bug #1213853
Change-Id: I56f810c6d451d68cb8326a0fa4f89462f74e9bf7
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
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
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
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
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
While in theory both VNC and SPICE can be enabled at the same
time, this is not expected to be common. Thus, rather than
adding a 'SPICE console' tab, this renames the existing
'VNC console' tab to simply be 'Console'. This tab is setup
to prefer exposing a VNC console, but if that is not enabled,
then expose the SPICE console. The reason for this order is
that the noVNC widget has had much more testing than the
current spice-html5 widget. Thus if both VNC & SPICE are
enabled, VNC is likely a more reliable choice at this point
in time.
Blueprint: libvirt-spice
Change-Id: If3d3769fe8e29c5930ac8b42d841c92182c4be72
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
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
-1 were interpreted literally, causing quota-related calculations to
show as overquota instead of unlimited
Fixes bug #1098480
Change-Id: I52377c690c5169f63624959711fce7566d59f9af
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
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