diff --git a/tasks/horizon_install_source.yml b/tasks/horizon_install_source.yml index 50e152ba..e5f53d1f 100644 --- a/tasks/horizon_install_source.yml +++ b/tasks/horizon_install_source.yml @@ -68,6 +68,18 @@ option: "venv_tag" value: "{{ horizon_venv_tag }}" +- name: Find the venv's python version + find: + paths: "{{ horizon_bin | dirname }}/lib/" + patterns: "python*" + file_type: directory + recurse: no + register: _horizon_python_venv_details + +- name: Set python lib dir fact + set_fact: + horizon_lib_dir: "{{ _horizon_python_venv_details.files[0].path }}/dist-packages" + - name: Create horizon link for venv file: src: "{{ horizon_lib_dir | dirname }}/site-packages" diff --git a/templates/openstack_dashboard.conf.j2 b/templates/openstack_dashboard.conf.j2 index f8d8a899..89eade18 100644 --- a/templates/openstack_dashboard.conf.j2 +++ b/templates/openstack_dashboard.conf.j2 @@ -40,7 +40,7 @@ {% endif %} WSGIScriptAlias / {{ horizon_lib_wsgi_file }} - WSGIDaemonProcess horizon user={{ horizon_system_user_name }} group={{ horizon_system_group_name }} processes={{ horizon_wsgi_processes | default(horizon_wsgi_threads) }} threads={{ horizon_wsgi_threads }} python-path={{ horizon_bin | dirname }}/lib/python2.7/site-packages + WSGIDaemonProcess horizon user={{ horizon_system_user_name }} group={{ horizon_system_group_name }} processes={{ horizon_wsgi_processes | default(horizon_wsgi_threads) }} threads={{ horizon_wsgi_threads }} python-path={{ horizon_lib_dir | dirname }}/site-packages WSGIProcessGroup horizon WSGIApplicationGroup %{GLOBAL} diff --git a/vars/debian.yml b/vars/debian.yml index a873119e..7b9ff0ce 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -67,5 +67,4 @@ horizon_apache_modules: state: "present" _horizon_lib_dir: "/usr/share/openstack-dashboard" -horizon_python_lib_dir: "/usr/lib/python2.7/dist-packages" horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/local/enabled" diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 45272363..7d0232a8 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -58,5 +58,4 @@ horizon_apache_default_sites: - "/etc/httpd/conf.d/ssl.conf" _horizon_lib_dir: "/usr/share/openstack-dashboard" -horizon_python_lib_dir: "/usr/lib/python2.7/site-packages" horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/local/enabled" diff --git a/vars/source_install.yml b/vars/source_install.yml index 8d2eaff9..6d65a87b 100644 --- a/vars/source_install.yml +++ b/vars/source_install.yml @@ -15,8 +15,11 @@ horizon_package_list: "{{ horizon_distro_packages }}" _horizon_bin: "/openstack/venvs/horizon-{{ horizon_venv_tag }}/bin" -_horizon_lib_dir: "{{ _horizon_bin | dirname }}/lib/python2.7/dist-packages" -horizon_python_lib_dir: "{{ _horizon_lib_dir }}" + +#NOTE(jrosser) for compatibility with py2 and py3 we detect the location of +#this dir during the source install and set a fact +#_horizon_lib_dir: "{{ _horizon_bin | dirname }}/lib/python2.7/dist-packages" + horizon_manage: "{{ _horizon_bin }}/horizon-manage.py" horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/local/enabled" _dashboard_panels_location: diff --git a/vars/suse.yml b/vars/suse.yml index 0ac624fb..dc0b3f39 100644 --- a/vars/suse.yml +++ b/vars/suse.yml @@ -77,5 +77,4 @@ horizon_apache_modules: state: "present" _horizon_lib_dir: "/srv/www/openstack-dashboard" -horizon_python_lib_dir: "/usr/lib/python2.7/site-packages" horizon_dashboard_panel_dir: "{{ _horizon_lib_dir }}/openstack_dashboard/enabled"