1050 Commits

Author SHA1 Message Date
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
Jenkins
f9b5d64bb8 Merge "Server-side filtering vpn" 2017-03-17 10:57:28 +00:00
liyingjun
87dbc2f9ff Support editing volume type access
Cinder v2 support add or remove volume type access for the given
project since Kilo [1]. This patch add this feature to horizon.
At least cinderclient 1.2.0 is required to support volume type
access extension.

[1]:
https://specs.openstack.org/openstack/cinder-specs/specs/kilo/private-volume-types.html

Implements blueprint: volume-type-access

Change-Id: I323d47ab2aed13305b609e27f8f959f40988537d
2017-03-14 12:58:31 +08:00
liyingjun
942fa3d7cd Fix the return value for glance get_version
The VERSIONS.get_version returned a Version object instead of a string,
it will raise ValueError: Circular reference detected when json encode.

This issue was introduced by commit
834722cf8af7b3471e9c7234da0bac8669025ca2

Change-Id: Ib41b2f7e77ac49911e9d5a4e129047f941bf5d24
Closes-bug: #1672291
2017-03-14 10:48:38 +08:00
Radomir Dopieralski
7be8078910 Consistently hash Version objects
The semantic_version.Version objects don't properly support hashing,
so we need to handle that in our wrapper, so that the "in" operator
can work properly with sets and dicts.

Closes-Bug: #1649819
Change-Id: I85e2b2214546817ef4da136b7d4267985ced94dc
2017-03-09 19:32:21 +01:00
xurong00037997
9f7bf67b87 Replace six.iteritems/itervalues with dict.items()/values()
1.As mentioned in [1], we should avoid using six.iteritems
to achieve iterators. We can use dict.items instead, as it will
return iterators in PY3 as well. And dict.items/keys will more
readable.
2.In py2, the performance about list should be negligible,
see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I88c133a37a11ef9049766a151a134106440bef6a
2017-03-08 01:33:07 +00:00
Jenkins
0093984adb Merge "Always pass the public endpoint to the client" 2017-03-03 00:33:58 +00:00
Jenkins
834722cf8a Merge "Properly compare versions in APIVersionManager" 2017-03-02 20:53:15 +00:00
Paulo Matias
446e5aefb4 Always pass the public endpoint to the client
Even if Horizon is configured to use internal endpoints for requests
made by its server side to other OpenStack services, the client side
should not be restricted to run only in networks which have access to
the internal endpoints.

Change-Id: Ibdc663a133670e8f07530c0d7c5ed7df2d92b99b
Closes-Bug: #1639080
2017-03-02 14:57:16 -03:00
Itxaka
4958805863 Merge "missing" quotas with nova quotas
There was an extra variable for the so called "missing"
quotas since 2013. This patch merges them with the
normal nova quotas, cleans up the tests, removes any
usage of that special var and as a side effect, adds
the missing keys to the project quota update page.

Change-Id: Icaac1ebb1749e13fdfc307e89dcc6bbd64bef922
Closes-Bug: 1655393
2017-03-01 15:30:33 +00:00
Luis Daniel Castellanos
277d15abff Added Server-side filtering for swift UI
Added server-side filtering for containers in swift UI using the
magic search directive.

Change-Id: Id0eaa818fab8b2c7d7a0ab40c1a943c2e7342f10
Partial-Implements: blueprint server-side-filtering
2017-02-06 15:28:58 -06:00
Jenkins
526ce2af1d Merge "Remove deprecated calls to novaclient.v2.contrib" 2017-02-06 20:21:17 +00:00
Jenkins
4c425daaf8 Merge "Only get detailed info for Nova servers when necessary" 2017-02-04 00:39:18 +00:00
Mateusz Kowalski
900a46064e Remove deprecated calls to novaclient.v2.contrib
As from OpenStack Ocata calls to novaclient.v2.contrib.instance_action
and novaclient.v2.contrib.list_extensions are deprecated
in favour of novaclient.v2.instance_action and
novaclient.v2.list_extensions respectively

Closes-bug: #1661767

Change-Id: I75d89a897093ef24fdb7f2c4a7c29c00fb3b2327
2017-02-04 00:03:49 +01:00
Lingxian Kong
c33b0840cb Only get detailed info for Nova servers when necessary
Horizon will get all servers from Nova in different several places,
but sometimes it only need ID and name instead of all the related
information of servers. novaclient already support 'detailed=False'
param for servers query.

Horizon page loading performance can also be improved with this patch.

Closes-Bug: #1661423
Change-Id: Ic4cc95cb4eaed0461a22ab1045fa83ba5a5e9ce4
2017-02-03 12:03:22 +13:00
Colleen Murphy
f7e2d7883d Pass the project domain ID to novaclient
When the nova client creates a new session, knowing only the ID and
project of a token but not the project's domain, it calls keystoneauth
with None as the project domain. Keystoneauth takes this to mean
novaclient wants to authenticate with the Identity v2.0 API, which
fails if the user is a federated user. This patch grabs the project
domain ID from the request and passes it along to novaclient so that it
can properly create a v3 Token session.

Change-Id: I7f00a9fefd64c453c40b08fbe235ac7e42153050
Depends-on: I18a9d42906cb2116903600d47880ebdfff1e1ef9
Partial-bug: #1660436
2017-02-02 18:32:03 +01:00
liaozd
60db0269e0 wrong indentations
Change-Id: I967fbe1e1e92851f1ca330cf43b00fc1d65e5b36
Closes-Bug: 1657450
2017-01-30 16:51:48 +00:00
Jenkins
d04936e34d Merge "Fix TypeError in api/neutron.py" 2017-01-27 18:25:08 +00:00
Radomir Dopieralski
8377fb9e18 Properly compare versions in APIVersionManager
Since the APIVersionManager stored the version numbers as ints and
floats, it was not possible to distinguish between version 1.2 and 1.20,
and also version 1.2 would be considered higher than version 1.13. With
the introduction of microversioning in some services, the version
numbers inflate quickly, making this a problem.

This patch wraps the version numbers in a Version object, that stores
the information as a semantic_version and correctly compares with other
Version objects, as well as ints, floats and strings.

It also removes the check for version being specified as a string, so
that it's possible to specify versions such as 1.20 without having to
explicitly create Version objects.

Change-Id: I0b0d87582d617290f08359ad181216cb99edb768
Closes-Bug: #1649819
2017-01-27 13:43:47 +00:00
Gábor Antal
41ee8c0677 Fix TypeError in api/neutron.py
In api/neutron.py [1], there is a logging, which throws a TypeError,
because the arguments of the format message is passed as a tuple,
which is not working when you pass the arguments to the logger,
instead of replacing in-place. In the current code, running the log
message leds to the following:

TypeError: not enough arguments for format string
Call stack:
  File "test.py", line 9, in <module>
    "router=%s", (router_id, router))
Message: 'router_static_route_list(): router_id=%s, router=%s'
Arguments: (('asd', 'asdf'),)

In this patchset, this bug is fixed.

[1]: https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/neutron.py#L1079

Change-Id: I233c435bb7ca89c6c8ecd49a66bccb5b59eedf41
Closes-Bug: #1659342
2017-01-25 17:14:56 +01:00
Radomir Dopieralski
20db9d94bf Try to use 2.40 microversion for simple-tenant-usages
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
2017-01-24 13:05:17 +01:00
Radomir Dopieralski
107bd083ef Simple tenant usage pagination
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
2017-01-24 11:01:31 +01:00
Eric Peterson
90a9af2e0b Autogenerate container name correctly for vol backup
The volume backup code is passing '' as a default container name,
which will cause cinder/swift to fail.   If no container name is provided,
the default value of None will enable the auto creation of a container correctly.

Change-Id: I7813153c65652ce6e1a5ac03204a8738eefdc64e
Closes-Bug: #1658137
2017-01-23 10:39:52 -07:00
liyingjun
49a5e68a17 Add missing scheduler_hints to _optional_create
The scheduler_hints option is missing from server_create rest api.
This patch adds it.

Change-Id: Iab587abecbfd73fec8e966ca86cdde7242c80207
Closes-bug: #1655255
2017-01-12 06:29:59 +00:00
jlopezgu
d0877ccd42 Server-side filtering vpn
Implements server-side filtering for vpns:
   - Project->Network->VPN

Implements blueprint: server-side-filtering

Change-Id: Ie752199a38a91969f9501037708372df3a154b53
2017-01-09 17:22:10 +00:00
Jenkins
e5dac64cb0 Merge "Improve novaclient initialisation" 2016-12-23 01:27:00 +00:00
Rob Cresswell
0a8094d2fb Improve novaclient initialisation
Following advice from the folk in #openstack-nova, we should make some
small changes to how we use novaclient to prevent a breakage in the
future.

Change-Id: I71795b4267edc76bb8b6c0914521f913b6c643a9
2016-12-20 15:40:16 +00:00
Timur Sufiev
f09a9ce4c7 Use the new fix_auth_url_version_prefix() call
It is a variation of existing fix_auth_url_version() call which
returns as a second value a boolean flag indicating whether the
auth_url was fixed to point to /v3 endpoint. So we could display a
more clear message to deployers from Horizon, based on the value of
this flag. The legacy fix_auth_url_version() call is to be phased out
as soon as Horizon cease to depend on it. Also provide a release note
about removing the old function.

Change-Id: I6c6a35b1c460e22dadf39634fce1bdfa257b8c63
Depends-On: I3a04d838a707465c8c6e81e0e6e2fcf918b7b059
2016-12-16 14:48:32 +03:00
jiangpch
d85a5b4b5d remove to_dict method of Network in neutron.py
because network['subnets'] is a list of str.

Closes-Bug: #1650097
Change-Id: I55b0c81706051410d7368a067106ff3d821d7b47
2016-12-15 11:23:19 +08:00
Cady_Chen
51fe944449 Replace six.iteritems(iter) with iter.items()
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
2016-12-14 11:13:20 +08:00
Matt Borland
1b153ca982 Allow router panel to not break sidebar
This patch handles an exception that is raised when the network service
is not present.  When unhandled, this causes the sidebar to not exist.

Change-Id: Ic5a94b267158d17a145c64c75fd7bf88e98478fa
Closes-Bug: 1647766
2016-12-06 15:32:26 +00:00
Jenkins
86bec0003e Merge "Wrap api calls with tracing decorators" 2016-12-02 11:59:40 +00:00
Jenkins
e83069a2c3 Merge "Make default domain usage consistent" 2016-12-02 01:17:18 +00:00
Paul Karikh
97945b5f6a Wrap api calls with tracing decorators
Since Horizon is going to be the first (or, one of the first)
OpenStack component using the new MongoDB driver, it won't be able to
retrieve traces made by other components using MongoDB driver (which
it should use because Ceilometer driver was too slow) for a
while. This means that Horizon itself is responsible for tracing the
rendering of its pages down to the layer where the flow of control
leaves Horizon domain. So, a lot of api wrappers in
openstack_dashboard.api are augmented with tracing decorator to
achieve this goal.

Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Implements-blueprint: openstack-profiler-at-developer-dashboard
Change-Id: Ib36692f0e9e68ed7fa0cd47919ba6581c9c8ab57
2016-12-01 19:31:10 +00:00
Eddie Ramirez
9963867cd9 Enable sorting by size in containers pane
The containers module was using an incorrect ID in the "Size" column,
preventing the user from sorting by "Size". This change updates the
ID s/size/bytes/ which is the resource property holding the actual object size
in Bytes.

This change also updates the default "subdir" size to 0, that is the
default value returned in the "Content-Length" header for "subdirectories"

Change-Id: I98d164ec1a08d15f25fcdbc92f45e46c9fa6e5c4
Closes-bug: 1643710
2016-11-30 17:49:10 +00:00
Colleen Murphy
2c104cc770 Make default domain usage consistent
The description for the OPENSTACK_KEYSTONE_DEFAULT_DOMAIN django
variable claims it refers to the ID of the domain. However, the
authenticate method of django_openstack_auth explicitly uses the name
when it requests a token[1], and when multidomain support is enabled
the user is asked for the domain name, not ID. If the operator tries to
set this variable to the ID of any domain besides keystone's own
Default domain, login will fail with "Could not find domain: <domain
ID>" in the keystone logs.  This patch forces horizon to use the
variable as a name instead of an ID and updates the comment, so that
everything using this variable is consistent with each other.

This wasn't caught before because the unit tests were only testing
against the default domain, so this patch also adds a second, enabled,
non-default mock domain to test with.

[1] http://git.openstack.org/cgit/openstack/django_openstack_auth/tree/openstack_auth/backend.py?h=2.4.1#n148

Change-Id: I4d16f831c9fc446859c9fb964b7609d5a76338fe
2016-11-28 12:41:06 +01:00
Jenkins
bbf6a5df56 Merge "Removing deprecate ceilometer code" 2016-11-22 18:41:31 +00:00
liyingjun
1a3ab89f22 Disable router and fip quotas when router is disabled
Currently Horizon unable to change quotas if routers extension is
disabled, fix this by adding router and floatingip quotas to
disabled_quotas when router extension is disabled.

Change-Id: I14d8a6e2e439ab48b62ce64c88ebb4643d11e49f
Closes-bug: #1457598
2016-11-18 17:27:34 +00:00
David Lyle
20ea82b9ef Removing deprecate ceilometer code
The ceilometer code has been deprecated and disabled for
several cycles. Now removing the code.

Change-Id: I1dcfb8aae6ce6898cb46f6312731a92a01ae0b67
2016-11-17 16:52:13 -07:00
Jenkins
5db645b8b0 Merge "Strip leading or trailing spaces from Instance names during update and create" 2016-11-14 05:12:10 +00:00
Cristiana Voicu
6519ce423a Get security groups of an instance using novaclient
Fix TODO related to security groups of an instance.

Co-Authored-By: Gleb Stepanov <gstepanov@mirantis.com>
Signed-off-by: Cristiana Voicu <cristiana.voicu@orange.com>

Change-Id: I7749c9d64bfd41086a6adfc4c3afd8b4c5029402
Fixes-Bug: 1641042
2016-11-11 07:59:46 +00:00
Jenkins
22b71f7c26 Merge "Drop LBaaS v1 dashboard" 2016-11-10 15:50:45 +00:00
Ernest Millan
4cfd243ee0 Strip leading or trailing spaces from Instance names during update and create
Fixes situation where exception and error is displayed for
Instance names which have a leading or trailing space.

Change-Id: Ida8d1f01acbaf4820e5fa94d12372a459bba8ed5
Closes-bug: #1634696
2016-11-08 08:32:25 -08:00
Jenkins
64aa8a66af Merge ""Unable to retrieve Domain" incessant warning logs" 2016-11-07 07:45:43 +00:00
Kam Nasim
55baf9254d "Unable to retrieve Domain" incessant warning logs
"openstack_dashboard.api.keystone: Unable to retrieve Domain: default"
incessant warning logging when switching Projects while being on the
Identity>Project panel.

Retrieving domain information is a Keystone admin URL operation. As a
pre-check, such operations would be Forbidden if the logon user does not
have an 'admin' role on the current project.

Since this is a common occurence, and can cause incessant warning
logging in the horizon logs, we recognize this condition and return the
user's domain information instead.

Signed-off-by: Kam Nasim <kam.nasim@windriver.com>

Closes-Bug: #1638662
Change-Id: Iadd5184a16a73da1da5a7230c89e996248f1eba7
2016-11-02 19:38:16 +00:00
Jenkins
30039df058 Merge "Server-side filtering Orchestration" 2016-11-02 18:50:35 +00:00
Akihiro Motoki
7e64a1cef1 Drop LBaaS v1 dashboard
LBaaS v1 feature was removed from neutron-lbaas in Newton.
There is no reason we have LBaaS v1 dashboard in Ocata or later.

Change-Id: Ic7d4ceea1943c3721500ce4b7f769b9dba28a359
Closes-Bug: #1624655
2016-10-18 08:57:26 +09:00
Eddie Ramirez
69e18fc42c Server-side filtering Orchestration
Included patch 12 changes
Implements blueprint: server-side-filtering
Co-authored-by: Revon Mathews <revon.mathews@intel.com>
Change-Id: I22c5c736f756b1f5640d2fc4d284ac45deaefc19
2016-10-17 15:50:17 +00:00
Jenkins
47edc6b6de Merge "Add Keystone Groups to REST API" 2016-10-13 20:04:32 +00:00
Cindy Lu
8130a79589 Add Keystone Groups to REST API
Adding REST API calls to retrieve group list

Co-Authored-By: zhurong <aaronzhu1121@gmail.com>

Partially-Implements: blueprint angularize-identity-tables
Change-Id: I12ca270036b4963fb20d3f6f1a630ded60a449f8
2016-10-11 11:33:37 -07:00