Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix : re.search() returns None/MatchObject, not a boolean, "\s*\t*" i…

…s equivalent to "\s*"
  • Loading branch information...
commit b7f9375b03d47000db9998db6b839860425fbadd 1 parent fc4984d
Guillaume Bour authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 shinken/objects/config.py
View
10 shinken/objects/config.py
@@ -531,7 +531,7 @@ def read_config_buf(self, buf):
# Now we removed real comments, replace them with just ;
line = line.replace('__ANTI-VIRG__', ';')
# A backslash means, there is more to come
- if re.search("\\\s*$", line):
+ if re.search("\\\s*$", line) is not None:
continuation_line = True
line = re.sub("\\\s*$", "", line)
line = re.sub("^\s+", " ", line)
@@ -544,14 +544,14 @@ def read_config_buf(self, buf):
tmp_line = ''
continuation_line = False
# } alone in a line means stop the object reading
- if re.search("^\s*\t*}\s*\t*$", line):
+ if re.search("^\s*}\s*$", line) is not None:
in_define = False
- if re.search("^\s*\t*#|^\s*$|^\s*}", line):
+
+ if re.search("^\s*#|^\s*$|^\s*}", line) is not None:
pass
-
# A define must be catch and the type save
# The old entry must be save before
- elif re.search("^define", line):
+ elif re.search("^define", line) is not None:
in_define = True
if tmp_type not in objectscfg:
objectscfg[tmp_type] = []

0 comments on commit b7f9375

Please sign in to comment.
Something went wrong with that request. Please try again.