27 Commits

Author SHA1 Message Date
He Yongli
869c50847d Use six.moves.urllib.parse instead of urlparse
To keep Python 3.x compatibility, use six.moves.urllib.parse to
replace urlparse.

Closes-Bug: #1279611
Change-Id: I712035926f449e1bc5ab1fe85927369b826cb9cc
2014-02-13 10:19:01 +08:00
Gary Kotton
ee537e33de Update RPC code from oslo
The common RPC code has been updated to include the following:
    8575d87af49ea276341908f83c8c51db13afca44
    8b2b0b743e84ceed7841cf470afed6a5da8e1d07
    23f602940c64ba408d77ceb8f5ba0f67ee4a18ef
    6d0a6c3083218cdac52758a8b6aac6b03402c658
    7cac1ac1bd9df36d4e5183afac3b643df10b1d4d
    8159efddabb09dd9b7c99963ff7c9de0a6c62b62

Updated to include the following in modules in openstack-common.conf:
py3kcompat, sslutils, and versionutils.

The update also includes imports from the RPC code

Change-Id: I84c5b8e2b17da0018dd69ecb354d123a609afe98
2014-01-15 04:26:57 -08:00
Paul Michali
e0f4a5d27c Remove dupl. for get_resources in adv. services
There is duplication of logic related to creating API resources
for advanced services extensions. Extracted the common logic
out into a new module that can be used by the services.
There are already UT cases in the services that exercises
the logic, so no new tests were added.

Change-Id: Ib52e2de6f215a1755f11a382dc4451a05ce3b147
Closes-Bug: 1258656
2013-12-28 11:38:35 -05:00
dekehn
6a6a4b1088 extra_dhcp_opt add checks for empty strings
When passing extra-dhcp-opt into the port-create where an empty string
is provided as opt_value='   ', the create and update routine will load the
empty string into the DB. The result when written to the opts file is:
"tag:ece4c8aa-15c9-4f6b-8c42-7d4e285734bf,option:server-ip-address", which
when read by dnsmasq has been tested to cause dnsmasq to segment fault.

Change-Id: I31de4a3d27092bb219d20221c5ef5a6b22e050dc
Closes-Bug: #1257467
2013-12-13 08:40:28 -07:00
Nachi Ueno
011b13bf51 Fix misspells
Change-Id: I8be38727ca55ebbead9032cf69f10a1006fd004b
Closes-bug:1257424
2013-12-03 15:03:47 -08:00
Jenkins
8b33d25fe0 Merge "Add support for NSX/NVP DHCP services" 2013-11-30 04:09:11 +00:00
armando-migliaccio
d1f143a266 Add support for NSX/NVP DHCP services
This is a feature patch (1 of 3) that adds support for DHCP
services provided by the NSX (aka NVP) platform. Green-field
deployments can use the AGENTLESS mode, which will make the
core plugin interact solely with the NSX platform to provide
DHCP services. Support for metadata proxy services, migration
for brown field deployments will be added in future patches.

Partial-implements blueprint nsx-integrated-services

Change-Id: Idfc4b2d871e70cd557d8e0e6b23e5563f9ed3420
2013-11-16 09:06:16 -08:00
dekehn
90534a6925 Adds delete of a extra_dhcp_opt on a port
Add support for delete of extra_dhcp_opt(s) on a port. Where
[{'opt_name': 'opt_to_delete', 'opt_value': None}].

Closes-Bug: #1228008

Change-Id: I75baeff91575cac6546fe2cc6fcf7a0d8e92853f
2013-11-14 14:36:01 -07:00
zhhuabj
d4127c622d Support uncompressed ipv6 address and abbreviated ipv4 address
Now neutron supports zero-compressed ipv6 address like
'2001:db8::10:10:10:0/120' and unabbreviated ipv4 address
like '10.0.0.0/24'.
This path will make neutron also support uncompressed ipv6
address and abbreviated ipv4 address. for example:
1, uncompressed ipv6 address like 'fe80:0:0:0:0:0:0:0/128'
2, ipv6 address with multiple consecutive zero like
   '2001:0db8:0:0:1::1/128' or '2001::0:1:0:0:1100/120'
3, abbreviated ipv4 address like '10/24'

Change-Id: I755e38ea11c139e15488ec60e7d5682a244ab114
Closes-Bug: #1240790
2013-10-23 09:28:52 +08:00
Oleg Bondarev
ddd2851208 Send proper exception info as expected by the neutron client
The python neutron client for the V2 API expects the neutron API
to send information back such as the type and detail of the exception
in the body of the message

Change-Id: I9486d757258c4be72799c41102babe1f7923121c
Closes-bug: #1226400
2013-09-19 17:32:30 +04:00
Avishay Balderman
abe3089906 _validate_network_tenant_ownership must be less strict
Neutron, currently does a strict validation code
so that for non-shared network the subnets and
ports must belong to the same tenant as the network. In
the case of a "service VM" created by
admin user, this function should return thus allowing
admin users to create ports and networks in a tenant
network.

Change-Id: Ied831402d56b98a1323d30eb6a769fd2df5278ee
Closes-Bug: #1221315
2013-09-16 12:55:48 +02:00
Luis A. Garcia
df73577ee2 Enhance exception translation to better handle NeutronExceptions
NeutronExceptions have a 'message' class attribute that holds the
generic error message template, e.g. "Network %(network)s not found",
unfortunately, because the names are the same, it was overshadowing the
actual exception instance 'message', e.g. "Network 1 not found", after
translation when the exception was serialized to JSON.

This patch puts the exception's actual message in a new field called
'msg' and overwrites NeutronException unicode() so that 'msg' is used
during serialization and we'll get the correct message on the REST API
response.

Fixes bug: #1212882

Change-Id: I3965bffb1c2c2eee0af440d1ecd30ccb3bb958d5
2013-09-12 18:43:15 +00:00
Bob Melander
d541adb746 Adds support for L3 routing/NAT as a service plugin
- Adds L3 routing/NAT service plugin
- Removes L3 routing/NAT from ML2 plugin
- Moves "router:external" attribute to new extension "External-net"
- Introduces separate RPC topic for L3 callbacks from L3 agent

Implements: blueprint quantum-l3-routing-plugin

Change-Id: Id9af10c2910f9a1730b163203a68d101ffc3b282
2013-09-11 12:12:10 +02:00
Paul Michali
8e76118dee Correct VPNaaS limit checks in extension
For the following VPNaaS attributes, ensure that these validation
tests are performed in the extension:

    keepalive >= 60 (seconds)
    mtu >= 0 (octets)
    DPD interval > 0 (seconds)
    DPD timeout > 0 (seconds)

Currently, the units for keepalive can only be seconds. If this
changes in the future (e.g. to allow kilobytes units), then the
test for the value will need to be changed.

To correctly test the MTU limits for an IPSec connection, the
protocol must be taken into consideration, which is defined by
the vpnservice object. Because of this dependency, we cannot
validate this in the extension, and will instead, just make
sure the value is positive.

Likewise, the attribute validators cannot ensure that the
DPD timeout is greater than the interval (again, because the
validators can only check the individual attributes one at
a time).

The range validator was modified to allow single ended ranges
for some of these attributes. The range also ensures the value
is an integer.

Companion changes are being made in the CLI code for these limit
changes.

Update: Fixed typo causing tox failure.

bug 1216117

Change-Id: I85d6175d81fbe7d27231aed48fb4691351e0db4c
2013-08-29 20:35:08 -04:00
Jenkins
5576bd7ec6 Merge "Enable conversion for composite attribute items" 2013-08-14 06:32:56 +00:00
Salvatore Orlando
5a5706e5bc Enable conversion for composite attribute items
Bug 1207881

Enable 'dict validators' to convert composite attributes' items
using a 'convert_to' specification in a way similar to first-level
API attributes.
This is needed in order to ensure boolean sub-attributes are
properly handled.

Change-Id: I7f466befaa88112cf7e9b77d854ac292b2af638f
2013-08-09 06:23:07 -07:00
Jenkins
c15013601a Merge "Fix H102, H103 Apache 2.0 license hacking check error" 2013-08-09 10:24:14 +00:00
Akihiro MOTOKI
c6ec44949e Fix H102, H103 Apache 2.0 license hacking check error
Closes-Bug: #1209070

This commit addresses H102 and H103 hacking check.
  H102  Apache 2.0 license header not found
  H103  Header does not match Apache 2.0 License notice

Also ignores H233 hacking check in tox.ini.
  H233  Python 3.x incompatible use of print operator

Change-Id: I081964bf0b9e21614da2f146bd3ba8d28e211024
2013-08-08 12:46:18 +09:00
Luis A. Garcia
f4606837d7 Externalize error messages in the API
This patch does more internationalization for the REST API error
messages that don't currently have it to take advantage of the new
support added by bp user-locale-api to show error messages in the locale
requested by the user through the Accept-Language HTTP header.

Partially implements bp user-locale-api

Change-Id: I92780b42c125a91ab4916b7a31e4b71d306a89a1
2013-08-07 21:19:25 +00:00
Luis A. Garcia
1d988b4c22 Enable localizable REST API responses via the Accept-Language header
Add support for doing language resolution for a request, based on the
Accept-Language HTTP header. Using the lazy gettext functionality, from
oslo gettextutils, it is possible to use the resolved language to
translate exception messages to the user requested language and
return that translation from the API.

Partially implements bp user-locale-api.

Change-Id: I63edc8463836bfff257daa8a2c66ed5d3a444254
2013-08-07 21:19:25 +00:00
Jenkins
16538cc0d2 Merge "Avoid performing extra query for fetching port security binding" 2013-07-31 23:29:34 +00:00
Jenkins
19576ca9e7 Merge "VPN as a Service (VPNaaS) API and DataModel" 2013-07-31 15:22:05 +00:00
Salvatore Orlando
69c9b32734 Avoid performing extra query for fetching port security binding
Bug 1201957

Add a relationship performing eager load in Port and Network
models, thus preventing the 'extend' function from performing
an extra database query.
Also fixes a comment in securitygroups_db.py

Change-Id: If0f0277191884aab4dcb1ee36826df7f7d66a8fa
2013-07-31 02:10:35 -07:00
Swaminathan Vasudevan
531f59478b VPN as a Service (VPNaaS) API and DataModel
implements:blueprint VPNaaS-Python-API

It provides the basic API and
DataModel for the "VPN As A
Service" feature that includes:
* VPNService
* IPsecSiteConnection
* IKEPolicy
* IPsecPolicy

Change-Id: I059d4db05118a4eecd388b8e8db0d714a8f9cb8f
2013-07-30 10:38:00 -07:00
Salvatore Orlando
1b27ddf4cc Fix logic for building field_list in update
Bug 1194520

Change-Id: Ie3ea7b77dc9a4f712e3e838c20c062db1b2d9faa
2013-07-30 00:16:58 -07:00
Yong Sheng Gong
4d66005043 validate and recommend the cidr
Bug #1195974

It is hard to validate the CIDR typed in by user,
the simple way is to recognize only one and recommend it
if user's input is not the one.

Change-Id: Ic8defe30a43a5ae69c3f737094f866b36bb68f59
2013-07-07 21:26:59 +08:00
Mark McClain
380b0e7db6 Rename Quantum to Neutron
This change renames everything to Neutron while providing backwards
compatible adjustments for Grizzly configuration files.

implements blueprint: remove-use-of-quantum

Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19
2013-07-06 15:02:43 -04:00