Dell S6100: Watchdog - Fix Python3 incompatibility (#6734)

To make watchdog.arm() method python3 compatible in DellEMC S6100.
This commit is contained in:
Arun Saravanan Balachandran 2021-02-10 14:13:24 +00:00 committed by GitHub
parent 7ea0d9e27a
commit 8ec747f2eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,9 +151,9 @@ class Watchdog(WatchdogBase):
if self.is_armed():
gpio_val = self._read_gpio_file(gpio)
high_val = gpio_val | (1 << 15)
if self._write_gpio_file(gpio, hex(high_val)) != -1:
if self._write_gpio_file(gpio, hex(high_val).encode('utf-8')) != -1:
low_val = high_val & 0xFFFF7FFF
if self._write_gpio_file(gpio, hex(low_val)) != -1:
if self._write_gpio_file(gpio, hex(low_val).encode('utf-8')) != -1:
self.armed_time = self._get_time()
self.timeout = seconds
return seconds