Retrieve any configuration property in a Custom Policy check
Last updated: September 2, 2025
The liquibase_utilities.get_config_value
python helper function allows you to retrieve any configuration property which includes environment variables, system properties, flow files, flow variables, and checks run
command line arguments. Conceptually, it works like property substitution within a Custom Policy check.
Syntax: liquibase_utilities.get_config_value("
CONFIGURATION_PROPERTY_VALUE
")
Retrieve any configuration property in a Custom Policy check
Have an existing checks settings file
Ensure the property you want to pull into your Custom policy check is set in one of the following ways:
Global flow file argument
Global CLI parameter
JAVA_OPTS Environment Variable system property
Liquibase environment variable
Procedure
Create a new file in your Liquibase working directory or a subdirectory like /scripts.
This file will contain the Python script that is your custom policy check. In this example, we title our new file custom_check_no_tables.py
.
Open the new custom_check_no_tables.py file and add the following custom policy check to it:
Retrieve any configuration property in a Custom Policy check
Liquibase will run the check against every object in the database, so this script doesn't need a Python looping mechanism to iterate through database objects.
Navigate to your Custom policy check Python script and add the configuration value desired.
This configuration value could be an environment variable, a system property, flow file, flow variable, or a checks run argument.
Helper function syntax: config_value=liquibase_utilities.get_config_value("
your-config-value
")
Examples of helper functions |
|
|
|
In this example, we will add the following piece of code to the Custom policy check which pulls in two configuration values called loglevel and mychangelog .
You can replace myloglevel
and mychangelog
with any property configured in the liquibase.properties file, flow file, global CLI parameters, JVM system properties, or as an environment variable.