fix a traceback in rb-site install with 1.7.7

Review Request #4074 — Created April 21, 2013 and submitted — Latest diff uploaded


Review Board


Fix a major (and simple) bug in the 1.7.7 release. When you don't specify the webserver port, it is passed in as an integer to rb-site, which blows up horribly as the re.sub expects a string. Example traceback:

* Installing the site...
Building site directories ... OK
Building site configuration files ... Traceback (most recent call last):
  File "/home/venvs/bin/rb-site", line 8, in <module>
    load_entry_point('ReviewBoard==1.7.7', 'console_scripts', 'rb-site')()
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/", line 1937, in main
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/", line 1405, in run
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/", line 1682, in show_install_status
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/", line 885, in step
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/", line 290, in generate_config_files
    os.path.join(conf_dir, web_conf_filename))
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/", line 626, in process_template
  File "/home/venvs/lib/python2.7/", line 151, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: sequence item 1: expected string, int found

I was running rb-site install via:

rb-site install \
  --copy-media \
  --noinput \
  --domain-name="${vhost}.${domain}" \
  --site-root=/ \
  --static-url=static/ \
  --media-url=media/ \
  --db-type=mysql \
  --db-name="$database" \
  --db-host=localhost \
  --db-user="$team" \
  --db-pass="$password" \
  --cache-type=memcached \
  --cache-info="localhost:11211" \
  --web-server-type=apache \
  --python-loader=wsgi \
Ran rb-site install post-patch and it works as expected.