# TODO(annak): This is a temporary solution
# nsxlib, which wraps policy API, is under development
# since policy API is yet to be finalized
function prepare_nsx_policy {
    NSXLIB_NAME='vmware-nsxlib'
    GITDIR[$NSXLIB_NAME]=/opt/stack/vmware-nsxlib
    GITREPO[$NSXLIB_NAME]=${NSXLIB_REPO:-${GIT_BASE}/openstack/vmware-nsxlib.git}
    GITBRANCH[$NSXLIB_NAME]=${NSXLIB_BRANCH:-stable/queens}

    if use_library_from_git $NSXLIB_NAME; then
        git_clone_by_name $NSXLIB_NAME
        setup_dev_lib $NSXLIB_NAME
    fi
}

function nsx_configure_neutron {
    iniset $NEUTRON_CONF DEFAULT core_plugin "vmware_nsx.plugin.NsxV3Plugin"
    iniset $NEUTRON_CONF group_policy policy_drivers "implicit_policy,nsx_policy"

    iniset /$Q_PLUGIN_CONF_FILE NSX_POLICY nsx_policy_manager $NSX_POLICY_MANAGER
    iniset /$Q_PLUGIN_CONF_FILE NSX_POLICY nsx_policy_username $NSX_POLICY_USERNAME
    iniset /$Q_PLUGIN_CONF_FILE NSX_POLICY nsx_policy_password $NSX_POLICY_PASSWORD
    iniset /$Q_PLUGIN_CONF_FILE NSX_POLICY nsx_manager_thumbprint $NSX_MANAGER_THUMBPRINT
}
