VOL-4334: Fix robot tests that stop logging prematurely when Delete Device
          is involved in TearDown step

Change-Id: I2e9a88ff591dfd4d178b6ed968bcc7b08446d740
diff --git a/tests/functional/Voltha_FailureScenarios.robot b/tests/functional/Voltha_FailureScenarios.robot
index 3d2f47e..9d9dba6 100755
--- a/tests/functional/Voltha_FailureScenarios.robot
+++ b/tests/functional/Voltha_FailureScenarios.robot
@@ -74,8 +74,9 @@
     [Tags]    functional   PowerSwitch
     [Setup]    Start Logging    ONUreboot_PowerSwitch
     [Teardown]    Run Keywords    Collect Logs
-    ...           AND             Stop Logging    ONUreboot_PowerSwitch
     ...           AND             Delete All Devices and Verify
+    ...           AND             Run Keyword If    ${logging}    Collect Logs
+    ...           AND             Stop Logging    ONUreboot_PowerSwitch
     # Add OLT device
     setup
     # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable
@@ -147,8 +148,9 @@
     [Tags]    functional   PhysicalOLTReboot
     [Setup]    Start Logging    PhysicalOLTReboot
     [Teardown]    Run Keywords    Collect Logs
-    ...           AND             Stop Logging    PhysicalOLTReboot
     ...           AND             Delete All Devices and Verify
+    ...           AND             Run Keyword If    ${logging}    Collect Logs
+    ...           AND             Stop Logging    PhysicalOLTReboot
     # Add OLT device
     setup
     # Performing Sanity Test to make sure subscribers are all AUTH+DHCP and pingable