]> git.openstreetmap.org Git - chef.git/commitdiff
Force use of python 2 for OSQA
authorTom Hughes <tom@compton.nu>
Mon, 12 Oct 2020 19:30:58 +0000 (19:30 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 12 Oct 2020 19:30:58 +0000 (19:30 +0000)
cookbooks/osqa/recipes/default.rb
cookbooks/python/resources/virtualenv.rb

index c56a2a9b6e05caa50f8aa136c556f3be94ba3f6a..3a229531f3d1408d79eca5fb295854a31b459ed4 100644 (file)
@@ -29,18 +29,15 @@ package "libpq-dev"
 
 python_directory = "/opt/osqa-python"
 
-python_virtualenv python_directory
+python_virtualenv python_directory do
+  interpreter "/usr/bin/python2"
+end
 
 python_package "Django" do
   python_virtualenv python_directory
   version "1.6.11"
 end
 
-python_package "html5lib" do
-  python_virtualenv python_directory
-  version "0.999"
-end
-
 python_package "Markdown" do
   python_virtualenv python_directory
   version "2.4"
@@ -56,11 +53,6 @@ python_package "python-openid" do
   version "2.2.5"
 end
 
-python_package "MySQL-python" do
-  python_virtualenv python_directory
-  version "1.2.3"
-end
-
 python_package "psycopg2" do
   python_virtualenv python_directory
   version "2.7.6.1"
@@ -71,6 +63,11 @@ python_package "South" do
   version "0.7.6"
 end
 
+python_package "html5lib" do
+  python_virtualenv python_directory
+  version "0.999"
+end
+
 apache_module "rewrite"
 apache_module "wsgi"
 
index cb372f4c3bb1c1730027d4ae8eed2a1dece99e23..6f07fd895bf69116a18f393e6895be8880bcfa29 100644 (file)
 default_action :create
 
 property :virtualenv_directory, :kind_of => String, :name_property => true
+property :interpreter, :kind_of => String, :default => "/usr/bin/python"
 
 action :create do
   execute "virtualenv-#{new_resource.virtualenv_directory}" do
-    command "virtualenv #{new_resource.virtualenv_directory}"
+    command "virtualenv --python=#{new_resource.interpreter} #{new_resource.virtualenv_directory}"
     not_if { ::File.exist?(new_resource.virtualenv_directory) }
   end
 end