Skip to content

Commit

Permalink
quote param in URL
Browse files Browse the repository at this point in the history
  • Loading branch information
CWollinger committed Apr 28, 2021
1 parent 5f72a4d commit 4be4f2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/1.2.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ bugfixes:
- grafana_dashboard now explicitely fails if the folder doesn't exist upon creation.
It would previously silently pass but not create the dashboard.
(https://github.com/ansible-collections/community.grafana/issues/153)
- grafana_team now able to handle spaces and other utf-8 chars in the name parameter.
(https://github.com/ansible-collections/community.grafana/issues/164)
3 changes: 2 additions & 1 deletion plugins/modules/grafana_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
from ansible.module_utils.urls import fetch_url, basic_auth_header
from ansible.module_utils._text import to_text
import ansible_collections.community.grafana.plugins.module_utils.base as base
from ansible.module_utils.six.moves.urllib.parse import quote

__metaclass__ = type

Expand Down Expand Up @@ -238,7 +239,7 @@ def create_team(self, name, email):
return response

def get_team(self, name):
url = "/api/teams/search?name={team}".format(team=name)
url = "/api/teams/search?name={team}".format(team=quote(name))
response = self._send_request(url, headers=self.headers, method="GET")
if not response.get("totalCount") <= 1:
raise AssertionError("Expected 1 team, got %d" % response["totalCount"])
Expand Down

0 comments on commit 4be4f2d

Please sign in to comment.