Skip to content

Commit 296c1e3

Browse files
committed
Move policy.json creation to _configure_neutron_common
To allow separating neutron l3, metadata, or dhcp agent from neutron server or controller, there is supposed to be policy.json on the nodes with l3, dhcp, metadata agent enabled, so it would be more appropriate to create policy.json in _configure_neutron_common. Change-Id: I890d647ffca05482f36ebaaf9c2c6e9e6cb23e2b
1 parent 2da606d commit 296c1e3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/neutron-legacy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,12 @@ function _configure_neutron_common {
878878

879879
cp $NEUTRON_DIR/etc/neutron.conf $NEUTRON_CONF
880880

881+
Q_POLICY_FILE=$NEUTRON_CONF_DIR/policy.json
882+
cp $NEUTRON_DIR/etc/policy.json $Q_POLICY_FILE
883+
884+
# allow neutron user to administer neutron to match neutron account
885+
sed -i 's/"context_is_admin": "role:admin"/"context_is_admin": "role:admin or user_name:neutron"/g' $Q_POLICY_FILE
886+
881887
# Set plugin-specific variables ``Q_DB_NAME``, ``Q_PLUGIN_CLASS``.
882888
# For main plugin config file, set ``Q_PLUGIN_CONF_PATH``, ``Q_PLUGIN_CONF_FILENAME``.
883889
# For addition plugin config files, set ``Q_PLUGIN_EXTRA_CONF_PATH``,
@@ -1106,13 +1112,7 @@ function _configure_neutron_plugin_agent {
11061112
# It is called when q-svc is enabled.
11071113
function _configure_neutron_service {
11081114
Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini
1109-
Q_POLICY_FILE=$NEUTRON_CONF_DIR/policy.json
1110-
11111115
cp $NEUTRON_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
1112-
cp $NEUTRON_DIR/etc/policy.json $Q_POLICY_FILE
1113-
1114-
# allow neutron user to administer neutron to match neutron account
1115-
sed -i 's/"context_is_admin": "role:admin"/"context_is_admin": "role:admin or user_name:neutron"/g' $Q_POLICY_FILE
11161116

11171117
# Update either configuration file with plugin
11181118
iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS

0 commit comments

Comments
 (0)