From e1aeb88b3810d9a24fef0aca0ccd9d37fa49fe44 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 14 Feb 2019 23:15:32 +0100 Subject: [PATCH] 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 --- releasenotes/notes/oslo-db-type-50bc9f614d50689a.yaml | 5 +++++ types/dbconn.pp | 1 + 2 files changed, 6 insertions(+) create mode 100644 releasenotes/notes/oslo-db-type-50bc9f614d50689a.yaml create mode 100644 types/dbconn.pp diff --git a/releasenotes/notes/oslo-db-type-50bc9f614d50689a.yaml b/releasenotes/notes/oslo-db-type-50bc9f614d50689a.yaml new file mode 100644 index 0000000..a27d839 --- /dev/null +++ b/releasenotes/notes/oslo-db-type-50bc9f614d50689a.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added new Oslo::Dbconn data type that can be used to validate + a database connection pattern. diff --git a/types/dbconn.pp b/types/dbconn.pp new file mode 100644 index 0000000..fadfa74 --- /dev/null +++ b/types/dbconn.pp @@ -0,0 +1 @@ +type Oslo::Dbconn = Pattern[/^(sqlite|mysql(\+pymysql)?|postgresql(\+psycopg2)?|mongodb):\/\/(\S+:\S+@\S+\/\S+)?/]