Set up pre-defined policy rules automatically in devstack install

In devstack install steps, congress plugin creates policy rules
defined in CONGRESS_PREDEFINED_POLICY_FILE. It enables users to create
thier policy automatically.

Change-Id: I09a08cfd5404e0d123573c0e432dc88c126772e5
Closes-Bug: #1638742
This commit is contained in:
Masahito Muroi 2017-01-16 20:19:41 +09:00
parent 9c7571daf9
commit b4b8a8070e
2 changed files with 12 additions and 0 deletions

View File

@ -121,6 +121,15 @@ function _configure_service {
fi
}
function create_predefined_policy {
if [ -n $CONGRESS_PREDEFINED_POLICY_FILE ] ; then
python $CONGRESS_DIR/scripts/preload-policies/output_policy_command.py \
$CONGRESS_PREDEFINED_POLICY_FILE | while read CONGRESS_CMD
do
$CONGRESS_CMD
done
fi
}
function configure_congressclient {
@ -291,6 +300,7 @@ if is_service_enabled congress; then
echo_summary "Starting Congress"
start_congress_service_and_check
configure_congress_datasources
create_predefined_policy
fi
if [[ "$1" == "unstack" ]]; then

View File

@ -36,6 +36,8 @@ CONGRESS_REPLICATED=${CONGRESS_REPLICATED:-False}
CONGRESS_TRANSPORT_URL=${CONGRESS_TRANSPORT_URL:-kombu+memory:////}
# Mutli process deployment
CONGRESS_MULTIPROCESS_DEPLOYMENT=${CONGRESS_MULTIPROCESS_DEPLOYMENT:-False}
# File path to predefined policy and rules
CONGRESS_PREDEFINED_POLICY_FILE=${CONGRESS_PREDEFINED_POLICY_FILE:-""}
# Setup default directories for client
#-------------------------------------