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
This commit is contained in:
Tobias Urdin 2019-02-14 23:15:32 +01:00
parent bf4076a01f
commit e1aeb88b38
2 changed files with 6 additions and 0 deletions

View File

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

1
types/dbconn.pp Normal file
View File

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