We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bug in create action for glesys provider
When creating an A record with the glesys provider, the full name is added instead of the host name. 
```
lexicon_config = {
    "provider_name" : "glesys",
    "action": "create", 
    "domain": "somedomain.com",
    "type": "A",
    "name": "lexicon",
    "content": "1.2.3.4",
    "glesys": {
    }
}
```
Results in the A-record:
`{'id': 2723410, 'type': 'A', 'name': 'lexicon.somedomain.com', 'ttl': 3600, 'content': '1.2.3.4'}`

While the expected result is:
`{'id': 2723410, 'type': 'A', 'name': 'lexicon', 'ttl': 3600, 'content': '1.2.3.4'}`

The request data sent to `domain/addrecord` :
`{'domainname': 'somedomain.com', 'host': 'lexicon.somedomain.com', 'type': 'A', 'data': '1.2.3.4', 'ttl': 3600}`

Expected request data to `domain/addrecord`: 
`{'domainname': 'somedomain.com', 'host': 'lexicon', 'type': 'A', 'data': '1.2.3.4', 'ttl': 3600}`

Glesys API documentation:
```
domain/addrecord

Url: https://api.glesys.com/domain/addrecord

Method: Only Https POST

Required arguments: domainname , host , type , data

Optional arguments: ttl

Description: Adds a dns record to a domain
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lexicon/providers/glesys.py`
Content:
```
1 """Module provider for Glesys"""
2 import json
3 
4 import requests
5 
6 from lexicon.exceptions import AuthenticationError
7 from lexicon.providers.base import Provider as BaseProvider
8 
9 NAMESERVER_DOMAINS = ["glesys.com"]
10 
11 
12 def provider_parser(subparser):
13     """Generate a subparser for Glesys"""
14     subparser.add_argument("--auth-username", help="specify username (CL12345)")
15     subparser.add_argument("--auth-token", help="specify API key")
16 
17 
18 class Provider(BaseProvider):
19     """Provider class for Glesys"""
20 
21     def __init__(self, config):
22         super(Provider, self).__init__(config)
23         self.domain_id = None
24         self.api_endpoint = "https://api.glesys.com"
25 
26     def _authenticate(self):
27         payload = self._get("/domain/list")
28         domains = payload["response"]["domains"]
29         for record in domains:
30             if record["domainname"] == self.domain:
31                 # Domain records do not have any id.
32                 # Since domain_id cannot be None, use domain name as id instead.
33                 self.domain_id = record["domainname"]
34                 break
35         else:
36             raise AuthenticationError("No domain found")
37 
38     # Create record. If record already exists with the same content, do nothing.
39     def _create_record(self, rtype, name, content):
40         existing = self.list_records(rtype, name, content)
41         if existing:
42             # Already exists, do nothing.
43             return True
44 
45         request_data = {
46             "domainname": self.domain,
47             "host": self._full_name(name),
48             "type": rtype,
49             "data": content,
50         }
51         self._addttl(request_data)
52 
53         self._post("/domain/addrecord", data=request_data)
54         return True
55 
56     # List all records. Return an empty list if no records found
57     # type, name and content are used to filter records.
58     # If possible filter during the query, otherwise filter after response is received.
59     def _list_records(self, rtype=None, name=None, content=None):
60         request_data = {"domainname": self.domain}
61         payload = self._post("/domain/listrecords", data=request_data)
62 
63         # Convert from Glesys record structure to Lexicon structure.
64         processed_records = [
65             self._glesysrecord2lexiconrecord(r) for r in payload["response"]["records"]
66         ]
67 
68         if rtype:
69             processed_records = [
70                 record for record in processed_records if record["type"] == rtype
71             ]
72         if name:
73             processed_records = [
74                 record
75                 for record in processed_records
76                 if record["name"] == self._full_name(name)
77             ]
78         if content:
79             processed_records = [
80                 record
81                 for record in processed_records
82                 if record["content"].lower() == content.lower()
83             ]
84 
85         return processed_records
86 
87     # Update a record. Identifier must be specified.
88     def _update_record(self, identifier, rtype=None, name=None, content=None):
89         request_data = {"recordid": identifier}
90         if name:
91             request_data["host"] = name
92         if rtype:
93             request_data["type"] = rtype
94         if content:
95             request_data["data"] = content
96 
97         self._addttl(request_data)
98         self._post("/domain/updaterecord", data=request_data)
99         return True
100 
101     # Delete an existing record.
102     # If record does not exist, do nothing.
103     # If an identifier is specified, use it, otherwise do a lookup using type, name and content.
104     def _delete_record(self, identifier=None, rtype=None, name=None, content=None):
105         delete_record_id = []
106         if not identifier:
107             records = self._list_records(rtype, name, content)
108             delete_record_id = [record["id"] for record in records]
109         else:
110             delete_record_id.append(identifier)
111 
112         for record_id in delete_record_id:
113             request_data = {"recordid": record_id}
114             self._post("/domain/deleterecord", data=request_data)
115 
116         return True
117 
118     # Helpers.
119     def _request(self, action="GET", url="/", data=None, query_params=None):
120         if data is None:
121             data = {}
122         if query_params is None:
123             query_params = {}
124 
125         query_params["format"] = "json"
126         default_headers = {
127             "Accept": "application/json",
128             "Content-Type": "application/json",
129         }
130 
131         credentials = (
132             self._get_provider_option("auth_username"),
133             self._get_provider_option("auth_token"),
134         )
135         response = requests.request(
136             action,
137             self.api_endpoint + url,
138             params=query_params,
139             data=json.dumps(data),
140             headers=default_headers,
141             auth=credentials,
142         )
143 
144         # if the request fails for any reason, throw an error.
145         response.raise_for_status()
146         return response.json()
147 
148     # Adds TTL parameter if passed as argument to lexicon.
149     def _addttl(self, request_data):
150         if self._get_lexicon_option("ttl"):
151             request_data["ttl"] = self._get_lexicon_option("ttl")
152 
153     # From Glesys record structure: [u'domainname', u'recordid', u'type', u'host', u'ttl', u'data']
154     def _glesysrecord2lexiconrecord(self, glesys_record):
155         return {
156             "id": glesys_record["recordid"],
157             "type": glesys_record["type"],
158             "name": glesys_record["host"],
159             "ttl": glesys_record["ttl"],
160             "content": glesys_record["data"],
161         }
162
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/lexicon/providers/glesys.py b/lexicon/providers/glesys.py
--- a/lexicon/providers/glesys.py
+++ b/lexicon/providers/glesys.py
@@ -44,7 +44,7 @@
 
         request_data = {
             "domainname": self.domain,
-            "host": self._full_name(name),
+            "host": name,
             "type": rtype,
             "data": content,
         }

{"golden_diff": "diff --git a/lexicon/providers/glesys.py b/lexicon/providers/glesys.py\n--- a/lexicon/providers/glesys.py\n+++ b/lexicon/providers/glesys.py\n@@ -44,7 +44,7 @@\n \n         request_data = {\n             \"domainname\": self.domain,\n-            \"host\": self._full_name(name),\n+            \"host\": name,\n             \"type\": rtype,\n             \"data\": content,\n         }\n", "issue": "Bug in create action for glesys provider\nWhen creating an A record with the glesys provider, the full name is added instead of the host name. \r\n```\r\nlexicon_config = {\r\n    \"provider_name\" : \"glesys\",\r\n    \"action\": \"create\", \r\n    \"domain\": \"somedomain.com\",\r\n    \"type\": \"A\",\r\n    \"name\": \"lexicon\",\r\n    \"content\": \"1.2.3.4\",\r\n    \"glesys\": {\r\n    }\r\n}\r\n```\r\nResults in the A-record:\r\n`{'id': 2723410, 'type': 'A', 'name': 'lexicon.somedomain.com', 'ttl': 3600, 'content': '1.2.3.4'}`\r\n\r\nWhile the expected result is:\r\n`{'id': 2723410, 'type': 'A', 'name': 'lexicon', 'ttl': 3600, 'content': '1.2.3.4'}`\r\n\r\nThe request data sent to `domain/addrecord` :\r\n`{'domainname': 'somedomain.com', 'host': 'lexicon.somedomain.com', 'type': 'A', 'data': '1.2.3.4', 'ttl': 3600}`\r\n\r\nExpected request data to `domain/addrecord`: \r\n`{'domainname': 'somedomain.com', 'host': 'lexicon', 'type': 'A', 'data': '1.2.3.4', 'ttl': 3600}`\r\n\r\nGlesys API documentation:\r\n```\r\ndomain/addrecord\r\n\r\nUrl: https://api.glesys.com/domain/addrecord\r\n\r\nMethod: Only Https POST\r\n\r\nRequired arguments: domainname , host , type , data\r\n\r\nOptional arguments: ttl\r\n\r\nDescription: Adds a dns record to a domain\r\n```\r\n\n", "before_files": [{"content": "\"\"\"Module provider for Glesys\"\"\"\nimport json\n\nimport requests\n\nfrom lexicon.exceptions import AuthenticationError\nfrom lexicon.providers.base import Provider as BaseProvider\n\nNAMESERVER_DOMAINS = [\"glesys.com\"]\n\n\ndef provider_parser(subparser):\n    \"\"\"Generate a subparser for Glesys\"\"\"\n    subparser.add_argument(\"--auth-username\", help=\"specify username (CL12345)\")\n    subparser.add_argument(\"--auth-token\", help=\"specify API key\")\n\n\nclass Provider(BaseProvider):\n    \"\"\"Provider class for Glesys\"\"\"\n\n    def __init__(self, config):\n        super(Provider, self).__init__(config)\n        self.domain_id = None\n        self.api_endpoint = \"https://api.glesys.com\"\n\n    def _authenticate(self):\n        payload = self._get(\"/domain/list\")\n        domains = payload[\"response\"][\"domains\"]\n        for record in domains:\n            if record[\"domainname\"] == self.domain:\n                # Domain records do not have any id.\n                # Since domain_id cannot be None, use domain name as id instead.\n                self.domain_id = record[\"domainname\"]\n                break\n        else:\n            raise AuthenticationError(\"No domain found\")\n\n    # Create record. If record already exists with the same content, do nothing.\n    def _create_record(self, rtype, name, content):\n        existing = self.list_records(rtype, name, content)\n        if existing:\n            # Already exists, do nothing.\n            return True\n\n        request_data = {\n            \"domainname\": self.domain,\n            \"host\": self._full_name(name),\n            \"type\": rtype,\n            \"data\": content,\n        }\n        self._addttl(request_data)\n\n        self._post(\"/domain/addrecord\", data=request_data)\n        return True\n\n    # List all records. Return an empty list if no records found\n    # type, name and content are used to filter records.\n    # If possible filter during the query, otherwise filter after response is received.\n    def _list_records(self, rtype=None, name=None, content=None):\n        request_data = {\"domainname\": self.domain}\n        payload = self._post(\"/domain/listrecords\", data=request_data)\n\n        # Convert from Glesys record structure to Lexicon structure.\n        processed_records = [\n            self._glesysrecord2lexiconrecord(r) for r in payload[\"response\"][\"records\"]\n        ]\n\n        if rtype:\n            processed_records = [\n                record for record in processed_records if record[\"type\"] == rtype\n            ]\n        if name:\n            processed_records = [\n                record\n                for record in processed_records\n                if record[\"name\"] == self._full_name(name)\n            ]\n        if content:\n            processed_records = [\n                record\n                for record in processed_records\n                if record[\"content\"].lower() == content.lower()\n            ]\n\n        return processed_records\n\n    # Update a record. Identifier must be specified.\n    def _update_record(self, identifier, rtype=None, name=None, content=None):\n        request_data = {\"recordid\": identifier}\n        if name:\n            request_data[\"host\"] = name\n        if rtype:\n            request_data[\"type\"] = rtype\n        if content:\n            request_data[\"data\"] = content\n\n        self._addttl(request_data)\n        self._post(\"/domain/updaterecord\", data=request_data)\n        return True\n\n    # Delete an existing record.\n    # If record does not exist, do nothing.\n    # If an identifier is specified, use it, otherwise do a lookup using type, name and content.\n    def _delete_record(self, identifier=None, rtype=None, name=None, content=None):\n        delete_record_id = []\n        if not identifier:\n            records = self._list_records(rtype, name, content)\n            delete_record_id = [record[\"id\"] for record in records]\n        else:\n            delete_record_id.append(identifier)\n\n        for record_id in delete_record_id:\n            request_data = {\"recordid\": record_id}\n            self._post(\"/domain/deleterecord\", data=request_data)\n\n        return True\n\n    # Helpers.\n    def _request(self, action=\"GET\", url=\"/\", data=None, query_params=None):\n        if data is None:\n            data = {}\n        if query_params is None:\n            query_params = {}\n\n        query_params[\"format\"] = \"json\"\n        default_headers = {\n            \"Accept\": \"application/json\",\n            \"Content-Type\": \"application/json\",\n        }\n\n        credentials = (\n            self._get_provider_option(\"auth_username\"),\n            self._get_provider_option(\"auth_token\"),\n        )\n        response = requests.request(\n            action,\n            self.api_endpoint + url,\n            params=query_params,\n            data=json.dumps(data),\n            headers=default_headers,\n            auth=credentials,\n        )\n\n        # if the request fails for any reason, throw an error.\n        response.raise_for_status()\n        return response.json()\n\n    # Adds TTL parameter if passed as argument to lexicon.\n    def _addttl(self, request_data):\n        if self._get_lexicon_option(\"ttl\"):\n            request_data[\"ttl\"] = self._get_lexicon_option(\"ttl\")\n\n    # From Glesys record structure: [u'domainname', u'recordid', u'type', u'host', u'ttl', u'data']\n    def _glesysrecord2lexiconrecord(self, glesys_record):\n        return {\n            \"id\": glesys_record[\"recordid\"],\n            \"type\": glesys_record[\"type\"],\n            \"name\": glesys_record[\"host\"],\n            \"ttl\": glesys_record[\"ttl\"],\n            \"content\": glesys_record[\"data\"],\n        }\n", "path": "lexicon/providers/glesys.py"}], "after_files": [{"content": "\"\"\"Module provider for Glesys\"\"\"\nimport json\n\nimport requests\n\nfrom lexicon.exceptions import AuthenticationError\nfrom lexicon.providers.base import Provider as BaseProvider\n\nNAMESERVER_DOMAINS = [\"glesys.com\"]\n\n\ndef provider_parser(subparser):\n    \"\"\"Generate a subparser for Glesys\"\"\"\n    subparser.add_argument(\"--auth-username\", help=\"specify username (CL12345)\")\n    subparser.add_argument(\"--auth-token\", help=\"specify API key\")\n\n\nclass Provider(BaseProvider):\n    \"\"\"Provider class for Glesys\"\"\"\n\n    def __init__(self, config):\n        super(Provider, self).__init__(config)\n        self.domain_id = None\n        self.api_endpoint = \"https://api.glesys.com\"\n\n    def _authenticate(self):\n        payload = self._get(\"/domain/list\")\n        domains = payload[\"response\"][\"domains\"]\n        for record in domains:\n            if record[\"domainname\"] == self.domain:\n                # Domain records do not have any id.\n                # Since domain_id cannot be None, use domain name as id instead.\n                self.domain_id = record[\"domainname\"]\n                break\n        else:\n            raise AuthenticationError(\"No domain found\")\n\n    # Create record. If record already exists with the same content, do nothing.\n    def _create_record(self, rtype, name, content):\n        existing = self.list_records(rtype, name, content)\n        if existing:\n            # Already exists, do nothing.\n            return True\n\n        request_data = {\n            \"domainname\": self.domain,\n            \"host\": name,\n            \"type\": rtype,\n            \"data\": content,\n        }\n        self._addttl(request_data)\n\n        self._post(\"/domain/addrecord\", data=request_data)\n        return True\n\n    # List all records. Return an empty list if no records found\n    # type, name and content are used to filter records.\n    # If possible filter during the query, otherwise filter after response is received.\n    def _list_records(self, rtype=None, name=None, content=None):\n        request_data = {\"domainname\": self.domain}\n        payload = self._post(\"/domain/listrecords\", data=request_data)\n\n        # Convert from Glesys record structure to Lexicon structure.\n        processed_records = [\n            self._glesysrecord2lexiconrecord(r) for r in payload[\"response\"][\"records\"]\n        ]\n\n        if rtype:\n            processed_records = [\n                record for record in processed_records if record[\"type\"] == rtype\n            ]\n        if name:\n            processed_records = [\n                record\n                for record in processed_records\n                if record[\"name\"] == self._full_name(name)\n            ]\n        if content:\n            processed_records = [\n                record\n                for record in processed_records\n                if record[\"content\"].lower() == content.lower()\n            ]\n\n        return processed_records\n\n    # Update a record. Identifier must be specified.\n    def _update_record(self, identifier, rtype=None, name=None, content=None):\n        request_data = {\"recordid\": identifier}\n        if name:\n            request_data[\"host\"] = name\n        if rtype:\n            request_data[\"type\"] = rtype\n        if content:\n            request_data[\"data\"] = content\n\n        self._addttl(request_data)\n        self._post(\"/domain/updaterecord\", data=request_data)\n        return True\n\n    # Delete an existing record.\n    # If record does not exist, do nothing.\n    # If an identifier is specified, use it, otherwise do a lookup using type, name and content.\n    def _delete_record(self, identifier=None, rtype=None, name=None, content=None):\n        delete_record_id = []\n        if not identifier:\n            records = self._list_records(rtype, name, content)\n            delete_record_id = [record[\"id\"] for record in records]\n        else:\n            delete_record_id.append(identifier)\n\n        for record_id in delete_record_id:\n            request_data = {\"recordid\": record_id}\n            self._post(\"/domain/deleterecord\", data=request_data)\n\n        return True\n\n    # Helpers.\n    def _request(self, action=\"GET\", url=\"/\", data=None, query_params=None):\n        if data is None:\n            data = {}\n        if query_params is None:\n            query_params = {}\n\n        query_params[\"format\"] = \"json\"\n        default_headers = {\n            \"Accept\": \"application/json\",\n            \"Content-Type\": \"application/json\",\n        }\n\n        credentials = (\n            self._get_provider_option(\"auth_username\"),\n            self._get_provider_option(\"auth_token\"),\n        )\n        response = requests.request(\n            action,\n            self.api_endpoint + url,\n            params=query_params,\n            data=json.dumps(data),\n            headers=default_headers,\n            auth=credentials,\n        )\n\n        # if the request fails for any reason, throw an error.\n        response.raise_for_status()\n        return response.json()\n\n    # Adds TTL parameter if passed as argument to lexicon.\n    def _addttl(self, request_data):\n        if self._get_lexicon_option(\"ttl\"):\n            request_data[\"ttl\"] = self._get_lexicon_option(\"ttl\")\n\n    # From Glesys record structure: [u'domainname', u'recordid', u'type', u'host', u'ttl', u'data']\n    def _glesysrecord2lexiconrecord(self, glesys_record):\n        return {\n            \"id\": glesys_record[\"recordid\"],\n            \"type\": glesys_record[\"type\"],\n            \"name\": glesys_record[\"host\"],\n            \"ttl\": glesys_record[\"ttl\"],\n            \"content\": glesys_record[\"data\"],\n        }\n", "path": "lexicon/providers/glesys.py"}]}