This might be cleaner:
group = [grp for grp in rv if grp.name == security_group_name][0]
It eliminates the iteration loop, and would have avoided the problem in the first place.
« Back to merge proposal
This might be cleaner:
group = [grp for grp in rv if grp.name == security_ group_name] [0]
It eliminates the iteration loop, and would have avoided the problem in the first place.