Show the contents of the configuration file.
(self, argv)
| 78 | sys.stdout.write("{}\n".format(plugins_table)) |
| 79 | |
| 80 | def show(self, argv): |
| 81 | """ |
| 82 | Show the contents of the configuration file. |
| 83 | """ |
| 84 | # pylint: disable=unused-argument |
| 85 | config_file = self.config.path |
| 86 | if not os.path.isfile(config_file): |
| 87 | raise CLIException("Unable to show the config file," |
| 88 | " '{path}' does not exist" |
| 89 | .format(path=config_file)) |
| 90 | |
| 91 | with open(config_file, 'r') as stream: |
| 92 | try: |
| 93 | sys.stdout.write("{stream}\n" |
| 94 | .format(stream=stream.read().rstrip())) |
| 95 | except Exception as exception: |
| 96 | raise CLIException("Unable to read config file '{path}':" |
| 97 | " {error}" |
| 98 | .format(path=config_file, error=exception)) |
no test coverage detected