Skip to content

Commit

Permalink
ddclient: Domeneshop - use '==' instead of 'is' (opnsense#3841)
Browse files Browse the repository at this point in the history
Since Python 3.8, 'is' and 'is not' produce warnings when its
behavior is undefined by the language spec.

See: https://docs.python.org/3.8/whatsnew/3.8.html#changes-in-python-behavior
  • Loading branch information
ssmendon authored Feb 26, 2024
1 parent a19de55 commit 808e7b5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def execute(self):
response = requests.get(**req_opts)

# Parse response and update state and log
if response.status_code is 204:
if response.status_code == 204:
if self.is_verbose:
syslog.syslog(
syslog.LOG_NOTICE,
"Account %s set new ip %s [%s] for %s" % (self.description, self.current_address, response.text.strip(), hostnames)
)
self.update_state(address=self.current_address, status=response.text.split()[0] if response.text else '')
return True
elif response.status_code is 404:
elif response.status_code == 404:
syslog.syslog(
syslog.LOG_ERR,
"Account %s failed to set new ip %s [%d - %s], because %s could not be found" % (
Expand Down

0 comments on commit 808e7b5

Please sign in to comment.