clean up multiline ifs
@@ -261,8 +261,8 @@ class Parser:
for rule in rules:
matches = 0
for r in rules[rule]:
- if r['rule'] and r['rule']['device_key'] and
- r['rule']['device_key'] == 'os':
+ if(r['rule'] and r['rule']['device_key'] and
+ r['rule']['device_key'] == 'os'):
match = False
if 'ipv4_addresses' in endpoint.metadata:
for ip in endpoint.metadata['ipv4_addresses']:
@@ -278,8 +278,8 @@ class Parser:
match = True
if match:
matches += 1
- elif r['rule'] and r['rule']['device_key'] and
- r['rule']['device_key'] == 'role':
+ elif( r['rule'] and r['rule']['device_key'] and
+ r['rule']['device_key'] == 'role'):
match = False
if 'mac_addresses' in endpoint.metadata:
for mac in endpoint.metadata['mac_addresses']:
@@ -303,8 +303,8 @@ class Parser:
match = True
if match:
matches += 1
- elif r['rule'] and r['rule']['device_key'] and
- r['rule']['device_key'] == 'behavior':
+ elif( r['rule'] and r['rule']['device_key'] and
+ r['rule']['device_key'] == 'behavior'):
match = False
if 'mac_addresses' in endpoint.metadata:
for mac in endpoint.metadata['mac_addresses']:
