diff --git a/README.md b/README.md index c9cb523..c4f5647 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ A new virtualenv will be created for the application in "#{path}/shared/env"; pi - legacy_database_settings: if true, the default settings template will generate legacy database config variables. Defaults to false - debug: used by the default settings template to control debugging. Defaults to false - collectstatic: controls the behavior of the `staticfiles` app. If true, if will invoke manage.py with `collectstatic --noinput`; you can also pass a String with an explicit command (see Usage below). Defaults to false +- allow_external: an array of pip packages that are allowed to be fetched from external sources. +- allow_unverified: an array of pip packages that are allowed to be installed without checking a checksum from a verified source. #### Database block parameters diff --git a/metadata.rb b/metadata.rb index a06b064..486e76c 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,10 +4,10 @@ license "Apache 2.0" description "Deploys and configures Python-based applications" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "3.0.1" +version "3.0.3" %w{ python gunicorn supervisor }.each do |cb| depends cb end -depends "application", "~> 3.0" +depends "application" diff --git a/providers/django.rb b/providers/django.rb index 0a58936..1cf98d4 100644 --- a/providers/django.rb +++ b/providers/django.rb @@ -58,7 +58,10 @@ if new_resource.requirements Chef::Log.info("Installing using requirements file: #{new_resource.requirements}") pip_cmd = ::File.join(new_resource.virtualenv, 'bin', 'pip') - execute "#{pip_cmd} install --source=#{Dir.tmpdir} -r #{new_resource.requirements}" do + pip_cmd << " install --source=#{Dir.tmpdir} -r #{new_resource.requirements}" + pip_cmd << new_resource.allow_external.map { |x| " --allow-external #{x}" }.join('') + pip_cmd << new_resource.allow_unverified.map { |x| " --allow-unverified #{x}" }.join('') + execute pip_cmd do cwd new_resource.release_path # seems that if we don't set the HOME env var pip tries to log to /root/.pip, which fails due to permissions # setting HOME also enables us to control pip behavior on per-project basis by dropping off a pip.conf file there diff --git a/resources/django.rb b/resources/django.rb index 5c5e601..aa9ba01 100644 --- a/resources/django.rb +++ b/resources/django.rb @@ -22,6 +22,8 @@ attribute :database_master_role, :kind_of => [String, NilClass], :default => nil attribute :packages, :kind_of => [Array, Hash], :default => [] +attribute :allow_external, :kind_of => Array, :default => [] +attribute :allow_unverified, :kind_of => Array, :default => [] attribute :requirements, :kind_of => [NilClass, String, FalseClass], :default => nil attribute :legacy_database_settings, :kind_of => [TrueClass, FalseClass], :default => false attribute :settings, :kind_of => Hash, :default => {}