django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().
https://docs.djangoproject.com/en/4.0/releases/3.0/#id3
Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
There is a case where volume_image_metadata attribute does not exist.
It looks like it happens for example when a volume was created before
the volume_image_metadata feature was implemented.
Change-Id: I0b8e6b2e540a1782b9edd9921490a9371d31afc7
Closes-Bug: #1916891
We have nova policies for all of these so should observe them. Otherwise
if a user e.g. doesn't have rights to view the console log of a VM they
will get an error every time they click on an instance name.
Change-Id: I78bb67621c4c0aea0a06bf10e9fe07a618ce8766
If an instance was created with a volume from an image, there is
no image details in instance overview page.
This patch adds image info from volume image-metadata.
Change-Id: I1da69eb4a65ab13f77d610b870bada994de876f2
Closes-Bug: 1833267
Cookie-based settings related to openstack_dashboard are located
under horizon directory,, but they are not related to "horizon".
This commit moves them to "openstack_dashboard" directory.
Part of blueprint ini-based-configuration
Change-Id: Id48ececdbe819a95485e9a91dc5a1a163a5568c3
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.
Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
Previously this had a check for is_superuser. That's sort of
right since the default nova-api policy doesn't return the hypervisor
if you don't have the admin priv.
But, since there is a modifiable policy enforced by the api,
let's just let that decide. If nova-api returns the hypervisor,
presumably it has decided that we're allowed to see it, so let's
see it!
Change-Id: I0cfe9090e8263f983fa5f42f42616a26407be47a
There is no easy way to edit security groups of ports attached
to an instance. This commit adds a table of ports attached to
an insntace to the instance detail. Users now can access attached
ports easily and edit their security groups.
Partial-Bug: #1750147
Change-Id: Ia2bd19f92251702878be3b12d0ea2a5c6618c65e
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3
blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
Added space between the nav-tabs and tab content on details panels.
Removed the bullet points in front of instance IP addresses
and security groups.
Change-Id: I426e73eca0ef8ac57434631da75cb602674be893
Closes-bug: #1625310
If the logined user is normal user, the instance overview page
will always show "HOST: -". There is no need show them for normal
users, it may cause some safety problem.
Closes-Bug: 1417849
Change-Id: Ib51bb05822fe910e97f73af56a8d6856764f7653
Adds support for serial console, in addition to VNC,
SPICE, and RDP.
Depends on term.js being added to OpenStack global
requirements: https://review.openstack.org/#/c/145825
To try this patch:
1. In `nova.conf`:
[serial_console]
enable=True
base_url =
ws://<location-of-serial-console-proxy>:6083/
2. Set CONSOLE_TYPE = "SERIAL" in local_settings.py.
3. You may need to start nova-serialproxy.
4. You may need to port-forward 6083.
https://review.openstack.org/#/c/143615 will make the
serial console available from Network Topology,
along with other consoles.
Co-Authored-By: Richard Jones<r1chardj0n3s@gmail.com>
Implements blueprint serial-console
Change-Id: If83c4efa1a96f9d393110af27f90a0808a23e641
The "open console" link in "Network Topology" does not autodetect
console type. This can be reproduced by setting CONSOLE_TYPE="AUTO" (or
ommiting the setting as AUTO is default value) while using SPICE
console.
Autodetection is correctly implemented in Instances view
(openstack_dashboard/dashboards/project/instances/console.py), but in
network topology
(openstack_dashboard/dashboards/project/network_topology/views.py in
JSONView) is only simple check, that ignore "RDP" and "AUTO".
Refactor get_console method, to return a tuple of console type and
console url, so other places can also use the method.
Change-Id: I064db5f1e5d363c9e6736703b66e78ad4e3de4d0
Closes-bug: #1403922
By default if you view the log of an instance in Horizon it is 35
lines. This patch allows user to override the default log length.
Change-Id: If7285ce31261f2442d3015161c445dda86240dfa
Closes-bug: #1387629
We where able to set the CONSOLE_TYPE in local_settings.py, but not able to
deactivate it.
We added a new option to CONSOLE_TYPE which is None.
To keep the legacy behaviour, CONSOLE_TYPE defaults to 'AUTO' and has to be
explicitly set to None to deactivate the console.
implements bp hide-vnc-console-access
Change-Id: Id23f3d5e37509b846858d480ad781f2b4ffc3590
Create a new dashboard in Horizon to show the actions taken on the
tenant's instances in reverse date order (latest first). This provides
the user with a view of what's been happening in their environment, and
any errors that have occurred.
Co-Authored-By: Nicolas Simonds <nicolas.simonds@metacloud.com>
Co-Authored-By: David Lapsley <david.lapsley@metacloud.com>
Co-Authored-By: Diana Whitten <diana.whitten@metacloud.com>
Implements: blueprint instance-actions-dashboard
Change-Id: I9cf54db7c2c65ac4679587fa2d8d185a04ae25dc
Console type "FAKE" not supported.
A unit test calls get_console() with a "FAKE" console type. The get_console()
call is logging both the key error and exception generated. Looking at the
get_console code, it doesn't seem necessary to log these exceptions at such a
high level at this point in the code.
Change-Id: Ibb96a4a483b71b5d4b8542b38f4e261ad50ea6d3
Closes-Bug: #1322262
Add a console module to handle the different kinds on remote consoles
supported (vnc, rdp, spice ) and refactor the code
to use console.get_console.
In the future, a matrix based on HyperVisor could be added
in case that only one type of console is supported.
Ex: HyperV <=> RDP
Change-Id: If448b7c9d953765b9b56ee14b39975d951ffd92c
Implements: blueprint refactor-console-support
Closes-Bug: #1287881
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
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
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
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
add a setting in local_settings.py that an administrator controls
the console type.
Fixes: bug #1155373
Change-Id: I57cf590cba56764712e6e832885eb49e346e3096
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
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