diff --git a/cvp_checks/tests/test_packet_checker.py b/cvp_checks/tests/test_packet_checker.py
index a583c24..f76c339 100644
--- a/cvp_checks/tests/test_packet_checker.py
+++ b/cvp_checks/tests/test_packet_checker.py
@@ -1,26 +1,24 @@
 import pytest
 import json
-import os
-from cvp_checks import utils
 
 
 def test_check_package_versions(local_salt_client, nodes_in_group):
-    output = local_salt_client.cmd("L@"+','.join(nodes_in_group), 'lowpkg.list_pkgs', expr_form='compound')
+    output = local_salt_client.cmd("L@"+','.join(nodes_in_group),
+                                   'lowpkg.list_pkgs',
+                                   expr_form='compound')
     # Let's exclude cid01 and dbs01 nodes from this check
     exclude_nodes = local_salt_client.cmd("I@galera:master or I@gerrit:client",
                                           'test.ping',
                                           expr_form='compound').keys()
-
-    if len(output.keys()) < 2:
+    total_nodes = [i for i in output.keys() if i not in exclude_nodes]
+    if len(total_nodes) < 2:
         pytest.skip("Nothing to compare - only 1 node")
 
     nodes = []
     pkts_data = []
     my_set = set()
 
-    for node in output:
-        if node in exclude_nodes:
-            continue
+    for node in total_nodes:
         nodes.append(node)
         my_set.update(output[node].keys())
 
@@ -44,19 +42,29 @@
 
 def test_check_module_versions(local_salt_client, nodes_in_group):
     pre_check = local_salt_client.cmd(
-        "L@"+','.join(nodes_in_group), 'cmd.run', ['dpkg -l | grep "python-pip "'], expr_form='compound')
+        "L@"+','.join(nodes_in_group),
+        'cmd.run',
+        ['dpkg -l | grep "python-pip "'],
+        expr_form='compound')
     if pre_check.values().count('') > 0:
         pytest.skip("pip is not installed on one or more nodes")
-    if len(pre_check.keys()) < 2:
+
+    exclude_nodes = local_salt_client.cmd("I@galera:master or I@gerrit:client",
+                                          'test.ping',
+                                          expr_form='compound').keys()
+    total_nodes = [i for i in pre_check.keys() if i not in exclude_nodes]
+
+    if len(total_nodes) < 2:
         pytest.skip("Nothing to compare - only 1 node")
-    output = local_salt_client.cmd("L@"+','.join(nodes_in_group), 'pip.freeze', expr_form='compound')
+    output = local_salt_client.cmd("L@"+','.join(nodes_in_group),
+                                   'pip.freeze', expr_form='compound')
 
     nodes = []
 
     pkts_data = []
     my_set = set()
 
-    for node in output:
+    for node in total_nodes:
         nodes.append(node)
         my_set.update([x.split("=")[0] for x in output[node]])
         output[node] = dict([x.split("==") for x in output[node]])
