Browse Source

Add Oslo::Dbconn data type

This a custom data type that moves the regular expression
pattern that we are using in oslo::db to a type so that
we can use it with validate_legacy and after that explicitly
as a data type for the parameters for database connection
strings.

Change-Id: Icbdd8f9dca5749eb9fadb8e3a5fba8dfd5f098d9
changes/66/637066/1
Tobias Urdin 2 years ago
parent
commit
e1aeb88b38
2 changed files with 6 additions and 0 deletions
  1. +5
    -0
      releasenotes/notes/oslo-db-type-50bc9f614d50689a.yaml
  2. +1
    -0
      types/dbconn.pp

+ 5
- 0
releasenotes/notes/oslo-db-type-50bc9f614d50689a.yaml View File

@ -0,0 +1,5 @@
---
features:
- |
Added new Oslo::Dbconn data type that can be used to validate
a database connection pattern.

+ 1
- 0
types/dbconn.pp View File

@ -0,0 +1 @@
type Oslo::Dbconn = Pattern[/^(sqlite|mysql(\+pymysql)?|postgresql(\+psycopg2)?|mongodb):\/\/(\S+:\S+@\S+\/\S+)?/]

Loading…
Cancel
Save