rackerlabs / mimic

An API mock service
Other
167 stars 57 forks source link

Specify listen port in required format #735

Closed jzoldak closed 7 years ago

jzoldak commented 7 years ago

Fixes a current issue on master, in which the twistd server will not start up, but instead gives the following error. Note that pip freeze shows Twisted==17.1.0.

File "/Users/foo/.virtualenvs/venv/bin/twistd", line 11, in <module>
    sys.exit(run())
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/scripts/twistd.py", line 29, in run
    app.run(runApp, ServerOptions)
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/application/app.py", line 662, in run
    runApp(config)
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/scripts/twistd.py", line 25, in runApp
    _SomeApplicationRunner(config).run()
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/application/app.py", line 380, in run
    self.application = self.createOrGetApplication()
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/application/app.py", line 440, in createOrGetApplication
    ser = plg.makeService(self.config.subOptions)
  File "/Users/foo/repos/mimic/mimic/tap.py", line 39, in makeService
    service(config['listen'], site).setServiceParent(s)
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/application/strports.py", line 40, in service
    endpoints.serverFromString(reactor, description), factory)
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/internet/endpoints.py", line 1569, in serverFromString
    nameOrPlugin, args, kw = _parseServer(description, None)
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/internet/endpoints.py", line 1487, in _parseServer
    getPlugins(IStreamServerEndpointStringParser), endpointType
  File "/Users/foo/.virtualenvs/venv/lib/python3.6/site-packages/twisted/internet/endpoints.py", line 1503, in _matchPluginToPrefix
    raise ValueError("Unknown endpoint type: '%s'" % (endpointType,))
ValueError: Unknown endpoint type: '8900'
glyph commented 7 years ago

Thanks @jzoldak .

Would you mind removing twistd.log from the .gitignore in this change? It's a separate issue that shouldn't be rolled into the same fix. (I actually think it shouldn't be ignored at all, but don't want to quibble about that while getting this important fix in :))

glyph commented 7 years ago

Since the tests are failing and this includes an irrelevant change, I'm going to close it. But the problem is very real! If you have a fix that addresses the problem and passes the tests, please re-open.

jzoldak commented 7 years ago

Thx for the look @glyph.

Removed the change to .gitignore Working on the tests. I don't have permissions to reopen so I'll put in a new PR once I get the tests sorted out.