Ticket #159 (new defect)

Opened 5 years ago

Last modified 2 years ago

Error with paster setup-app and proxy-prefix filter

Reported by: bbangert Owned by: ianb
Priority: normal Milestone:
Component: deploy Version: svn-trunk
Severity: normal Keywords:
Cc: thrawn01@…

Description

(Moving from Pylons trac, ticket 206 there)

I've noticed that if I add:

[app:main]
filter-with = proxy-prefix

[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /

to my config.ini, paster setup-app config.ini fails with the following:

Traceback (most recent call last):
  File "/var/www/virtual/somesite.com/bin/paster", line 5, in ?
    pkg_resources.run_script('PasteScript==1.1', 'paster')
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 407, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1084, in run_script
    execfile(script_filename, namespace, namespace)
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteScript-1.1-py2.4.egg/EGG-INFO/scripts/paster", line 18, in ?
    command.run()
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteScript-1.1-py2.4.egg/paste/script/command.py", line 76, in run
    invoke(command, command_name, options, args[1:])
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteScript-1.1-py2.4.egg/paste/script/command.py", line 115, in invoke
    exit_code = runner.run(args)
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteScript-1.1-py2.4.egg/paste/script/appinstall.py", line 64, in run
    return super(AbstractInstallCommand, self).run(new_args)
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteScript-1.1-py2.4.egg/paste/script/command.py", line 210, in run
    result = self.command()
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteScript-1.1-py2.4.egg/paste/script/appinstall.py", line 442, in command
    conf = appconfig(config_spec, relative_to=os.getcwd())
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteDeploy-1.1-py2.4.egg/paste/deploy/loadwsgi.py", line 205, in appconfig
    return context.config()
  File "/var/www/virtual/somesite.com/lib/python2.4/site-packages/PasteDeploy-1.1-py2.4.egg/paste/deploy/loadwsgi.py", line 609, in config
    conf = AttrDict(self.global_conf)
TypeError: iteration over non-sequence

For now I take the easy route and simply add that bit of configuration after running setup-app, but this is appears to be a bug or at least worth documenting.

Attachments

patch-159.patch Download (1.2 KB) - added by thrawn01 2 years ago.
PEP-8 police, patch is now in compliance

Change History

Changed 3 years ago by iElectric

filter-with does not work at all when using setup-app, the alternative is pipeline for now

Changed 2 years ago by thrawn01

  • cc thrawn01@… added

This issue occurs because appconfig() from paste.deploy returns the filter context as it is the last context parsed by the ConfigLoader?(). The resolution is to crawl the filter tree until we find the application config.

The patch also cleans up the error message, as is misleading.

Changed 2 years ago by thrawn01

PEP-8 police, patch is now in compliance

Note: See TracTickets for help on using tickets.