Skip to content

Commit

Permalink
The rstrip() method removes slashes at the end of the path string ins…
Browse files Browse the repository at this point in the history
…tead of slicing

Signed-off-by: geyaning <[email protected]>
  • Loading branch information
geyaning committed Jul 13, 2023
1 parent 40b75f1 commit 76e0163
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions avocado/utils/cloudinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ def do_POST(self):
Respond with status 200 if the instance phoned back.
"""
path = self.path[1:]
if path[-1] == "/":
path = path[:-1]
path = self.path[1:].rstrip("/")
if path == self.server.instance_id:
self.server.instance_phoned_back = True
self.send_response(200)
Expand Down

0 comments on commit 76e0163

Please sign in to comment.