Refactored the checking method to be easier to read

This commit is contained in:
Joona Hoikkala
2016-01-05 13:16:49 +02:00
parent 10a49532ae
commit 63f311eea4
@@ -500,18 +500,19 @@ class ApacheParser(object):
"""
try:
use_new = False
remove_old = False
new_file_match = os.path.basename(filepath)
existing_match = self.parser_paths[os.path.dirname(filepath)]
if existing_match == new_file_match:
# True here to let augeas verify that the path is parsed
use_new = True
elif new_file_match == "*":
if existing_match == "*":
use_new = False
else:
use_new = True
if new_file_match == "*":
remove_old = True
else:
remove_old = False
except KeyError:
use_new = True
remove_old = False
return use_new, remove_old
def _remove_httpd_transform(self, filepath):