Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

no need for solitude proxy any more #517

Merged
merged 1 commit into from Aug 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 0 additions & 26 deletions bin/docker/supervisor.conf
Expand Up @@ -11,34 +11,8 @@ stdout_logfile=logs/docker.log
stdout_logfile_maxbytes=1MB
stopsignal=KILL
environment=
# See also the payments-env docker files for environment vars.

# Note: that this proxy setting will be replaced when solitude-auth
# is completed for all providers.
SOLITUDE_ZIPPY_PROXY="http://solitude-auth:2603/v1/reference/",
SOLITUDE_URL="http://solitude:2602"

# Note: that this will be removed when solitude-auth is completed for all
# providers.
[program:proxy]
# There's no need to wrap this command because it doesn't need mysql
# or other things.
command=python /srv/solitude/manage.py runserver 0.0.0.0:2603
directory=/srv/solitude
stopasgroup=true
autostart=true
redirect_stderr=true
stdout_logfile=logs/docker-proxy.log
stdout_logfile_maxbytes=1MB
stopsignal=KILL
# This will turn on the proxy.
environment=
SOLITUDE_DATABASE="",
SOLITUDE_PROXY="enabled"


# The following sections enable supervisorctl.

[inet_http_server]
port=9001

Expand Down
8 changes: 5 additions & 3 deletions lib/provider/tests/test_views.py
Expand Up @@ -28,9 +28,11 @@ class TestAPIView(TestCase):

def test_no_reference(self):
req = RequestFactory().get('/')
with self.settings(ZIPPY_MOCK=False):
eq_(ProxyView().dispatch(req, reference_name='bob',
resource_name='sellers').status_code, 404)
with self.assertRaises(KeyError):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this test doing? Do we still need it? I can't decipher from the test name what it's testing.

with self.settings(ZIPPY_MOCK=False):
eq_(ProxyView().dispatch(
req, reference_name='bob',
resource_name='sellers').status_code, 404)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're just going for a KeyError maybe you don't need eq_ ?



class TestAPIasProxy(TestCase):
Expand Down
3 changes: 2 additions & 1 deletion solitude/settings/base.py
Expand Up @@ -477,7 +477,8 @@
}

# The URL for a solitude proxy to zippy.
ZIPPY_PROXY = os.getenv('SOLITUDE_ZIPPY_PROXY', '')
ZIPPY_PROXY = os.getenv(
'SOLITUDE_ZIPPY_PROXY', 'http://solitude-auth:2603/v1/reference/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a little nicer to account for empty variable values which sometimes happens in docker setups. This would do it:

os.getenv('SOLITUDE_ZIPPY_PROXY') or 'http://solitude-auth:2603/v1/reference/'


# End Zippy settings.
###############################################################################
Expand Down