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 a1aa62e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions avocado/utils/cloudinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,15 @@ 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.rstrip('/')
if path == self.server.instance_id:
self.server.instance_phoned_back = True
self.send_response(200)

def log_message(self, format_, *args): # pylint: disable=W0221
"""Logs an arbitrary message.

:note: It currently disables any message logging.
"""
def log_message(self, format_, *args): # pylint: disable=W0221
"""Logs an arbitrary message."""
pass


class PhoneHomeServer(HTTPServer):
Expand Down

0 comments on commit a1aa62e

Please sign in to comment.