Commit Graph

7 Commits

Author SHA1 Message Date
Boden R 94221c60ad consume sqlalchemytypes from neutron-lib
The neutron.db.sqlalchemytypes module we rehomed into neutron-lib [1].
This patch consumes it by removing the module and unit tests from
neutron and using them from neutron-lib where applicable.

NeutronLibImpact

[1] https://review.openstack.org/#/c/639117/

Change-Id: I3ab76ca3813d550a4de454cc83156a55325f6abc
2019-03-25 07:51:23 -06:00
Gary Kotton 5acfa37999 For typo in sqlalchemytypes
TrivialFix

Change-Id: I06407cf474e3c98851f277ba03effe691d8b40ef
2017-02-13 16:18:46 +00:00
Kevin Benton cd80ae6e42 Truncate microseconds before DB insertion
During the development of patch [1], it became apparent
that the DB was rounding the microseconds part of a datetime
object. This caused inconsistencies between what would be
stored in the DB and what was returned to the user via the
API because the API uses strftime.

For an example, see the INSERT statement on L1-L2 and then
the subsequent retrieval of the same record on L43 of [2].
The microseconds were rounded up even though the mysql docs
say they will be truncated.

In order to ensure consistency across SQL drivers, backends,
and our API, this patch adds a TruncatedDateTime object which
truncates off the microseconds before they go into the database.

1. I78b00516e31ce83376d37f57299b2229b6fb8fcf
2. http://paste.openstack.org/show/565116/

Closes-Bug: #1619299
Change-Id: I47d5ad5a5cdc0cb0d61f0642616cccc8f341ed62
2016-09-01 13:25:24 +00:00
Akihiro Motoki 44be13a2a6 Hacking rule to check i18n usage
* Detect neutron.i18n import (neutron._i18n is recommended)
* Check builtins _ usage
* 'builtins = _' in tox.ini is no longer required.
* Introduce hacking rule doctest framework.
  Newly added check_builtins_gettext() hacking check takes
  token as argument. It is not a good idea to pass a tokenized
  line manually. Instead it is reasonable to use docstring based
  tests used in hacking repo.

Change-Id: Ib7464658fc4c8a6f1b03af6ab46f0bd3ee0bfb18
2016-03-30 21:28:37 -04:00
Saisrikiran Mudigonda 487ad1dea4 Add custom SQLAlchemy type for MACAddress
Related-Bug: #277558
Change-Id: I5aed64b083fb848cb16bd34b1ca167a264531e03
2016-03-15 17:31:55 +01:00
Artur Korzeniewski 4f995c3cb0 Add custom SQLAlchemy type for CIDR
Change-Id: I8e67012179d9cc6d27a2fdf47477857609c4c856
2016-03-15 14:55:38 +01:00
Saisrikiran Mudigonda 8785edc0e7 Add custom SQLAlchemy type for IP addresses
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Martin Hickey <martin.hickey@ie.ibm.com>
Change-Id: I4709548b385cf19156bc0589058a31cb301a6b5f
Partial-Bug: #1541928
2016-03-15 08:32:26 +01:00