(self, fullpath, fstat, test=False)
| 578 | self.command = value |
| 579 | |
| 580 | def execute(self, fullpath, fstat, test=False): |
| 581 | try: |
| 582 | command = self.command.replace("{}", fullpath) |
| 583 | print(salt.utils.args.shlex_split(command)) |
| 584 | p = Popen(salt.utils.args.shlex_split(command), stdout=PIPE, stderr=PIPE) |
| 585 | (out, err) = p.communicate() |
| 586 | if err: |
| 587 | log.error( |
| 588 | "Error running command: %s\n\n%s", |
| 589 | command, |
| 590 | salt.utils.stringutils.to_str(err), |
| 591 | ) |
| 592 | return f"{command}:\n{salt.utils.stringutils.to_str(out)}\n" |
| 593 | |
| 594 | except Exception as e: # pylint: disable=broad-except |
| 595 | log.error('Exception while executing command "%s":\n\n%s', command, e) |
| 596 | return f"{fullpath}: Failed" |
| 597 | |
| 598 | |
| 599 | class Finder: |
no test coverage detected