Skip to content
Snippets Groups Projects
Commit ebf19462 authored by Martin Blanchard's avatar Martin Blanchard
Browse files

cmd_server.py: Catch socket configuration errors

parent 33ccb979
No related branches found
No related tags found
No related merge requests found
Pipeline #43393595 passed
...@@ -24,6 +24,7 @@ import sys ...@@ -24,6 +24,7 @@ import sys
import click import click
from buildgrid._exceptions import PermissionDeniedError
from buildgrid.server._authentication import AuthMetadataMethod, AuthMetadataAlgorithm from buildgrid.server._authentication import AuthMetadataMethod, AuthMetadataAlgorithm
from buildgrid.server.instance import BuildGridServer from buildgrid.server.instance import BuildGridServer
from buildgrid.server._monitoring import MonitoringOutputType, MonitoringOutputFormat from buildgrid.server._monitoring import MonitoringOutputType, MonitoringOutputFormat
...@@ -120,8 +121,13 @@ def _create_server_from_config(configuration): ...@@ -120,8 +121,13 @@ def _create_server_from_config(configuration):
server = BuildGridServer(**kargs) server = BuildGridServer(**kargs)
for channel in network: try:
server.add_port(channel.address, channel.credentials) for channel in network:
server.add_port(channel.address, channel.credentials)
except PermissionDeniedError as e:
click.echo("Error: {}.".format(e), err=True)
sys.exit(-1)
for instance in instances: for instance in instances:
instance_name = instance['name'] instance_name = instance['name']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment