Initialize oldstat at the top of the function

It is not essential but it is safer if the code is changed in the future...

[flake8](http://flake8.pycqa.org) testing of https://github.com/Aidaho12/haproxy-wi on Python 3.7.0

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
/home/travis/virtualenv/python3.7.0/lib/python3.7/site-packages/pycodestyle.py:113: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
./app/tools/checker_worker.py:70:27: F821 undefined name 'oldstat'
				if (currentstat[i] != oldstat[i] and currentstat[i]!="none") and ("FRONTEND" not in str(vips[i]) and "BACKEND" not in str(vips[i])):
                          ^
1     F821 undefined name 'oldstat'
1
```
pull/30/head
cclauss 2018-08-11 18:38:47 +02:00 committed by GitHub
parent c0dbf08f23
commit e74db7c856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ def main(serv, port):
port = str(port)
firstrun = True
currentstat = []
oldstat = []
readstats = ""
killer = GracefulKiller()
old_stat_service = ""