MCPcopy Create free account
hub / github.com/apache/mesos / show

Method show

src/python/cli_new/lib/cli/plugins/config/main.py:80–98  ·  view source on GitHub ↗

Show the contents of the configuration file.

(self, argv)

Source from the content-addressed store, hash-verified

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))

Callers 7

updateFunction · 0.80
bootstrap.jsFile · 0.80
bootstrap.min.jsFile · 0.80
nrFunction · 0.80

Calls 4

CLIExceptionClass · 0.90
openFunction · 0.50
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected