|
|
|
|
|
|
|
|
return _error(name, e.message) |
|
|
return _error(name, e.message) |
|
|
|
|
|
|
|
|
adds = False |
|
|
adds = False |
|
|
|
|
|
inserts = False |
|
|
updates = False |
|
|
updates = False |
|
|
for line in out.split('\n'): |
|
|
for line in out.split('\n'): |
|
|
if re.match('^Skipping', line): |
|
|
if re.match('^Skipping', line): |
|
|
|
|
|
|
|
|
if re.match('^Rule(s)? added', line): |
|
|
if re.match('^Rule(s)? added', line): |
|
|
adds = True |
|
|
adds = True |
|
|
break |
|
|
break |
|
|
|
|
|
if re.match('^Rule(s)? inserted', line): |
|
|
|
|
|
inserts = True |
|
|
|
|
|
break |
|
|
if re.match('^Rule(s)? updated', line): |
|
|
if re.match('^Rule(s)? updated', line): |
|
|
updates = True |
|
|
updates = True |
|
|
break |
|
|
break |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if adds: |
|
|
if adds: |
|
|
return _changed(name, "{0} added".format(name), rule=rule) |
|
|
return _changed(name, "{0} added".format(name), rule=rule) |
|
|
|
|
|
elif inserts: |
|
|
|
|
|
return _changed(name, "{0} inserted".format(name), rule=rule) |
|
|
elif updates: |
|
|
elif updates: |
|
|
return _changed(name, "{0} updated".format(name), rule=rule) |
|
|
return _changed(name, "{0} updated".format(name), rule=rule) |
|
|
else: |
|
|
else: |