Skip to content

Instantly share code, notes, and snippets.

def real_task(command, asg=None, host_list=None, first_n=None):
if asg is None and host_list is None:
print("You need to provide either --asg or --host-list parameter")
exit(1)
filters = [{
'Name': 'tag:aws:autoscaling:groupName',
'Values': [asg]
}]
max_cnt = None if first_n is None else int(first_n)
ip_list_provided = None if host_list is None else host_list.split(',')