fix a traceback in rb-site install with 1.7.7

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

Information

Review Board
master

Reviewers

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/rbsite.py", line 1937, in main
    command.run()
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1405, in run
    self.show_install_status()
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1682, in show_install_status
    site.generate_config_files)
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/rbsite.py", line 885, in step
    func()
  File "/home/venvs/lib/python2.7/site-packages/ReviewBoard-1.7.7-py2.7.egg/reviewboard/cmdline/rbsite.py", 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/rbsite.py", line 626, in process_template
    template)
  File "/home/venvs/lib/python2.7/re.py", 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 \
"${basedir}/$vhost"
Ran rb-site install post-patch and it works as expected.