| Total Complexity | 3 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | from lib.sensu import SensuAction |
||
| 8 | class SilenceAction(SensuAction): |
||
| 9 | def run(self, check, client, expiration, message): |
||
| 10 | path = 'silence/{}'.format(client) |
||
| 11 | if check: |
||
| 12 | path = "{}/{}".format(path, check) |
||
| 13 | |||
| 14 | payload = {} |
||
| 15 | payload['message'] = message |
||
| 16 | |||
| 17 | if expiration: |
||
| 18 | payload['expire'] = expiration |
||
| 19 | |||
| 20 | return self.api.create_stash(payload, path) |
||
| 21 |