Skip to content

Commit

Permalink
add some breaks in loops
Browse files Browse the repository at this point in the history
  • Loading branch information
pescobar committed Oct 31, 2020
1 parent 8c6b50e commit 09d4ef4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/modules/guacamole_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def main():
if 'name' in connection:
if connection['name'] == module.params.get('connection_name'):
result['connection_info'] = connection
break

module.exit_json(**result)

Expand Down
3 changes: 3 additions & 0 deletions plugins/modules/guacamole_connections_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ def main():
if group_info['name'] == module.params.get('group_name'):
group_numeric_id = group_info['identifier']
guacamole_connections_group_exists = True
break

# module arg state=present so we have to create a new connections group
# or update an existing one
Expand Down Expand Up @@ -437,10 +438,12 @@ def main():
for group_id, group_info in guacamole_connections_groups_after.items():
if group_info['name'] == module.params.get('group_name'):
result['connections_group_info'] = group_info
break
else:
for group_id, group_info in guacamole_connections_groups_before.items():
if group_info['name'] == module.params.get('group_name'):
result['connections_group_info'] = group_info
break

module.exit_json(**result)

Expand Down
5 changes: 3 additions & 2 deletions plugins/modules/guacamole_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ def main():

# check if the user already exists in guacamole
guacamole_user_exists = False
for user in guacamole_users_before.items():
if user[1]['username'] == module.params.get('username'):
for username, userinfo in guacamole_users_before.items():
if username == module.params.get('username'):
guacamole_user_exists = True
break

Expand Down Expand Up @@ -606,6 +606,7 @@ def main():
for username, userinfo in guacamole_users_after.items():
if username == module.params.get('username'):
result['user_info'] = userinfo
break

module.exit_json(**result)

Expand Down

0 comments on commit 09d4ef4

Please sign in to comment.