Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import os
  2.  
  3. # Open the listS
  4. instancefile = open('instances', 'r')
  5. lbfile = open('loadbalancers', 'r')
  6. # Create Python lists
  7. with instancefile as f:
  8. instances = [x.strip('\n') for x in f.readlines()]
  9. with lbfile as f:
  10. loadbalancers = [x.strip('\n') for x in f.readlines()]
  11.  
  12. for lb in loadbalancers:
  13. for i in instances:
  14. command = str("elb-register-instances-with-lb " + lb + " --instances " + i)
  15. os.system(command)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement