Skip to content

Instantly share code, notes, and snippets.

@bchess
Created May 23, 2017 22:15
Show Gist options
  • Save bchess/2900f9379ca4e4dac47dd103600e3c9c to your computer and use it in GitHub Desktop.
Save bchess/2900f9379ca4e4dac47dd103600e3c9c to your computer and use it in GitHub Desktop.
diff --git a/paasta_tools/utils.py b/paasta_tools/utils.py
index 061a87a..1fecb7c 100644
--- a/paasta_tools/utils.py
+++ b/paasta_tools/utils.py
@@ -1969,3 +1969,10 @@ class _Timeout(object):
exc_info = ret[1]
six.reraise(*exc_info)
raise TimeoutError(self.error_message)
+
+def services_running_here_via_docker():
+ for container in get_running_mesos_docker_containers():
+ service = container['Labels'].get('paasta_service')
+ instance = container['Labels'].get('paasta_instance')
+ if service and instance:
+ yield service, instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment