Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail gracefully for invalid network names #1

Open
sanimej opened this issue Jun 7, 2017 · 0 comments
Open

Fail gracefully for invalid network names #1

sanimej opened this issue Jun 7, 2017 · 0 comments

Comments

@sanimej
Copy link
Owner

sanimej commented Jun 7, 2017

Currently a traceback is thrown if the passed network name doesn't exist.

smanohar@net16-1:~/code/go/src/github.com/sanimej/ssd$ docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/run/docker/netns:/var/run/docker/netns --net=host --privileged sanimej/ssd ov2
Verifying LB programming for containers on network ov2
Traceback (most recent call last):
  File "/ssd.py", line 179, in <module>
    check_network(sys.argv[1])
  File "/ssd.py", line 59, in check_network
    data = cli.inspect_network(nw_name, verbose=True)
  File "/usr/lib/python2.7/site-packages/docker/utils/decorators.py", line 35, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/docker/api/network.py", line 188, in inspect_network
    return self._result(res, json=True)
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 220, in _result
    self._raise_for_status(response)
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 216, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python2.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.NotFound: 404 Client Error: Not Found ("network ov2 not found")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant