diff --git a/fig/cli/command.py b/fig/cli/command.py index 035cdf010..5ac0b48f1 100644 --- a/fig/cli/command.py +++ b/fig/cli/command.py @@ -8,6 +8,7 @@ import os import re import yaml import six +import sys from ..project import Project from ..service import ConfigError @@ -69,7 +70,7 @@ If it's at a non-standard location, specify the URL with the DOCKER_HOST environ else: log.error(e) - exit(1) + sys.exit(1) try: return Project.from_config(self.project_name, config, self.client) diff --git a/fig/cli/main.py b/fig/cli/main.py index a484534f7..eee5563f5 100644 --- a/fig/cli/main.py +++ b/fig/cli/main.py @@ -39,18 +39,18 @@ def main(): command.sys_dispatch() except KeyboardInterrupt: log.error("\nAborting.") - exit(1) + sys.exit(1) except (UserError, NoSuchService, DependencyError) as e: log.error(e.msg) - exit(1) + sys.exit(1) except NoSuchCommand as e: log.error("No such command: %s", e.command) log.error("") log.error("\n".join(parse_doc_section("commands:", getdoc(e.supercommand)))) - exit(1) + sys.exit(1) except APIError as e: log.error(e.explanation) - exit(1) + sys.exit(1) # stolen from docopt master diff --git a/fig/cli/socketclient.py b/fig/cli/socketclient.py index b0bb087b6..6cc1f2c57 100644 --- a/fig/cli/socketclient.py +++ b/fig/cli/socketclient.py @@ -115,7 +115,7 @@ if __name__ == '__main__': if len(sys.argv) != 2: sys.stderr.write("Usage: python socketclient.py WEBSOCKET_URL\n") - exit(1) + sys.exit(1) url = sys.argv[1] socket = websocket.create_connection(url)