Micro-optimization of inventory.expand_hosts.detect_range
This commit is contained in:
parent
7b2fb7e2d1
commit
a7da5d8702
1 changed files with 1 additions and 4 deletions
|
@ -41,10 +41,7 @@ def detect_range(line = None):
|
|||
|
||||
Returnes True if the given line contains a pattern, else False.
|
||||
'''
|
||||
if (line.find("[") != -1 and
|
||||
line.find(":") != -1 and
|
||||
line.find("]") != -1 and
|
||||
line.index("[") < line.index(":") < line.index("]")):
|
||||
if 0 <= line.find("[") < line.find(":") < line.find("]"):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue