Browse Source

Properly update device status on re-ZTP.

Joe Clarke 5 years ago
parent
commit
be60c85e4c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      www/swreg/callhome.php

+ 2 - 2
www/swreg/callhome.php

@@ -86,10 +86,10 @@ if ($row['should_re_ztp'] == 2) {
     echo "! RE-ZTP\r\n";
     $logger->info("Sending RE-ZTP message for switch {$sn}");
 
-    $sql = 'UPDATE DEVICE_MAP SET should_re_ztp=? WHERE serial_number=?';
+    $sql = 'UPDATE DEVICE_MAP SET should_re_ztp=?, provisioned_status=?, device_status=? WHERE serial_number=?';
     try {
         $sth = $dbh->prepare($sql);
-        $res = $sth->execute(array(0, $sn));
+        $res = $sth->execute(array(0, PROVISION_IN_PROGRESS, REACHABILITY_NEVER_REACHABLE, $sn));
     } catch (PDOException $e) {
         $logger->crit("Failed to reset re-ZTP bit for {$sn}: {$e->getMessage()}");
     }