Commit 7cb50891 authored by Robert Loehning's avatar Robert Loehning
Browse files

Squish: Don't use global variable for __isWinFirewallRunning__()

Change-Id: Iaad1da549addbb856515ae95ece4ae43246637fa
Reviewed-by: default avatarChristian Stenger <>
parent fac11973
import re
# flag that caches the information whether Windows firewall is running or not
fireWallState = None
# this function modifies all necessary run settings to make it possible to hook into
# the application compiled by Creator
......@@ -310,17 +308,16 @@ def __configureFW__(workingDir, projectName, isReleaseBuild, addToFW=True):
# helper to check whether win firewall is running or not
# this doesn't check for other firewalls!
def __isWinFirewallRunning__():
global fireWallState
if fireWallState != None:
return fireWallState
if hasattr(__isWinFirewallRunning__, "fireWallState"):
return __isWinFirewallRunning__.fireWallState
if not platform.system() in ('Microsoft' 'Windows'):
fireWallState = False
__isWinFirewallRunning__.fireWallState = False
return False
result = getOutputFromCmdline("netsh firewall show state")
for line in result.splitlines():
if "Operational mode" in line:
fireWallState = not "Disable" in line
return fireWallState
__isWinFirewallRunning__.fireWallState = not "Disable" in line
return __isWinFirewallRunning__.fireWallState
return None
# this function adds the given executable as an attachable AUT
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment