CLI: Support for https url in option --node-url

This patch modifies the regular expression used for verifying of '--node-url'
parameter.  Support for accessing a Tahoe gateway over HTTPS was already
present, thanks to Python's urllib.
This commit is contained in:
Francois Deppierraz 2010-04-30 11:56:09 -07:00
parent e2031aff0f
commit dd95e8e71b
2 changed files with 6 additions and 1 deletions
src/allmydata

@ -2,7 +2,7 @@ import os.path, re, sys, fnmatch
from twisted.python import usage
from allmydata.scripts.common import BaseOptions, get_aliases
NODEURL_RE=re.compile("http://([^:]*)(:([1-9][0-9]*))?")
NODEURL_RE=re.compile("http(s?)://([^:]*)(:([1-9][0-9]*))?")
class VDriveOptions(BaseOptions, usage.Options):
optParameters = [

@ -88,6 +88,11 @@ class CLI(unittest.TestCase):
"--node-url", "http://localhost:8080"])
self.failUnlessEqual(o["node-url"], "http://localhost:8080/")
o = cli.ListOptions()
o.parseOptions(["--node-directory", "cli/test_options",
"--node-url", "https://localhost/"])
self.failUnlessEqual(o["node-url"], "https://localhost/")
def _dump_cap(self, *args):
config = debug.DumpCapOptions()
config.stdout,config.stderr = StringIO(), StringIO()