30 Commits

Author SHA1 Message Date
Akihiro Motoki
cd7c1b5110 Address RemovedInDjango40Warning (2)
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
2022-02-04 16:22:07 +09:00
Akihiro Motoki
b841952906 Handle an attached volume without volume_image_metadata
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
2021-02-28 07:34:59 +09:00
Andrew Bogott
b4fd4c2e76 Server tabs: add policy enforcement for tab display
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
2021-02-12 14:52:25 -06:00
Tatiana Ovchinnikova
5de6df19dc Add image data for instance with volume
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
2019-11-13 16:53:24 +01:00
Akihiro Motoki
7c897b677c Move openstack_dashboard specific settings from horizon
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
2019-09-12 15:05:56 +09:00
Akihiro Motoki
fcdc67b819 Define default settings explicitly (openstack_dashboard 3/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.

Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
2019-07-03 14:54:16 +09:00
andrewbogott
1f13da0e47 Server overview: display hypervisor name if available
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
2018-11-01 14:54:14 -05:00
Akihiro Motoki
ff5b622da5 Add instance interfaces tab for easy security group edit
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
2018-04-22 07:40:52 +09:00
Akihiro Motoki
e477eafa45 django2: Replace django.core.urlresolves with django.urls
(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
2018-02-17 01:36:48 +09:00
Ying Zuo
a21b51e34a Fix alignment issues for nav-tabs and ul on details panels
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
2017-01-18 11:40:14 -08:00
Gleb Stepanov
313bc692e3 Fix comment typo
Change-Id: I93ecaab29bcfb43dc1f650808bbc9d6061b52121
2016-09-06 14:00:41 +00:00
jingliuqing
8bf9025cda Remove serial console hardcode url
Change-Id: I32aa1cfcfeb504d3c7fc47d244314b2ff11f3031
2015-06-27 09:53:08 +08:00
jing.liuqing
5ae1f3c44f Hidden HOST in instance overview page for normal user
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
2015-06-03 07:05:31 +00:00
Randy Bertram
6ab60fde7f Serial Console
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
2015-02-19 04:49:11 +00:00
liyingjun
a9b2f7b3cc Make auto console type in network topology work
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
2015-02-12 10:51:38 -05:00
nikunj2512
9873c1c46b Adds ability to set default log length
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
2014-11-20 16:44:55 +00:00
Yves-Gwenael Bourhis
3ef7d3ae99 Add a None option to the CONSOLE_TYPE setting
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
2014-09-01 10:21:05 +02:00
Diana Whitten
45ba74af05 Instance Action Dashboard Blueprint
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
2014-08-29 16:18:26 -06:00
David Lapsley
5955f52c6b Exception traces in the test output
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
2014-06-18 08:33:05 -07:00
Leandro I. Costantino
ded54e6f5d Refactor code around Console support
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
2014-05-20 03:00:28 +00:00
He Yongli
e790ac070e Remove extraneous vim configuration comments
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
2014-05-06 15:30:10 +08:00
Alessandro Pilotti
ccfbdedb11 Adds support for Nova RDP console
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
2014-03-01 01:21:47 +02:00
Radomir Dopieralski
028332da4a Remove #noqa from most common imports and add them to import_exceptions
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
2014-01-07 12:26:35 +01: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
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
Zhenguo Niu
c5f968afee Add settings for console type (vnc vs spice)
add a setting in local_settings.py that an administrator controls
the console type.

Fixes: bug #1155373

Change-Id: I57cf590cba56764712e6e832885eb49e346e3096
2013-05-30 22:17:31 +00:00
Daniel P. Berrange
59b7e6011b Add support for SPICE consoles
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>
2013-01-24 10:14:55 +00: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
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