Skip to content
Browse files

Notes on integration with fabric

  • Loading branch information...
1 parent aabc739 commit 0d6d7f647322e616b6e6e33d2b6c675dc7dc1d68 @mnielsen committed
Showing with 12 additions and 1 deletion.
  1. +12 −1 ec2.py
View
13 ec2.py
@@ -1,7 +1,9 @@
"""
ec2.py
~~~~~~
-Simple EC2 cluster management with Python.
+
+Simple EC2 cluster management with Python. Designed for easy
+integration with `fabric`.
Mostly a convenience wrapper around the boto library.
@@ -133,6 +135,15 @@ def check_environment_variables_exist(*args):
def public_dns_names(cluster_name):
"""
Return a list containing the public dns names for `cluster_name`.
+
+ This is returned in a format which is designed to be used in a
+ `fabric` fabfile. In particular, we can tell `fabric` about the
+ cluster by importing `ec2` in our fabfile, and then putting the
+ line:
+
+ `env.hosts = ec2.public_dns_names(CLUSTER_NAME)`
+
+ into the fabfile.
"""
if cluster_name not in clusters:
print ("Cluster name %s not recognized. Exiting ec2.ec2_hosts()." %

0 comments on commit 0d6d7f6

Please sign in to comment.
Something went wrong with that request. Please try again.