diff --git a/cli/dcoscli/data/help/package.txt b/cli/dcoscli/data/help/package.txt index 79a175d..972fb25 100644 --- a/cli/dcoscli/data/help/package.txt +++ b/cli/dcoscli/data/help/package.txt @@ -56,8 +56,7 @@ Options: --cli Command line only. --config - Print the the configurable properties for the `marathon.json` and - `command.json` files. + Print the the configurable properties for the `marathon.json` file. --index= The numerical position in the package repository list. Package repositories are searched in descending order. By default the Universe @@ -73,9 +72,8 @@ Options: --package-versions Print all versions for this package. --render - Collate the marathon.json or command.json package templates with the - values from config.json and --options. If not provided, print the raw - templates. + Collate the marathon.json package template with the values from + config.json and --options. If not provided, print the raw templates. --version Print version information. --yes diff --git a/cli/dcoscli/package/main.py b/cli/dcoscli/package/main.py index 6a3436e..09b41e9 100644 --- a/cli/dcoscli/package/main.py +++ b/cli/dcoscli/package/main.py @@ -229,8 +229,7 @@ def _describe(package_name, :param options_path: Path to json file with options to override config.json defaults. :type options_path: str - :param render: If True, marathon.json and/or command.json templates - will be rendered + :param render: If True, marathon.json will be rendered :type render: boolean :param package_versions: If True, a list of all package versions will be printed @@ -273,11 +272,7 @@ def _describe(package_name, options = pkg.options(user_options) if cli: - if render: - cli_output = pkg.command_json(options) - else: - cli_output = pkg.command_template() - emitter.publish(cli_output) + emitter.publish(pkg.command_json()) if app: if render: app_output = pkg.marathon_json(options) diff --git a/cli/tests/data/help/package.txt b/cli/tests/data/help/package.txt index 79a175d..972fb25 100644 --- a/cli/tests/data/help/package.txt +++ b/cli/tests/data/help/package.txt @@ -56,8 +56,7 @@ Options: --cli Command line only. --config - Print the the configurable properties for the `marathon.json` and - `command.json` files. + Print the the configurable properties for the `marathon.json` file. --index= The numerical position in the package repository list. Package repositories are searched in descending order. By default the Universe @@ -73,9 +72,8 @@ Options: --package-versions Print all versions for this package. --render - Collate the marathon.json or command.json package templates with the - values from config.json and --options. If not provided, print the raw - templates. + Collate the marathon.json package template with the values from + config.json and --options. If not provided, print the raw templates. --version Print version information. --yes diff --git a/dcos/cosmospackage.py b/dcos/cosmospackage.py index 749b0f8..0f2f75e 100644 --- a/dcos/cosmospackage.py +++ b/dcos/cosmospackage.py @@ -1,8 +1,6 @@ import collections import functools -import json -import pystache import six from dcos import emitting, http, util from dcos.errors import (DCOSAuthenticationException, @@ -365,14 +363,6 @@ class CosmosPackageVersion(): return self._resource_json - def command_template(self): - """ Returns raw data from command.json - - :returns: raw data from command.json - :rtype: str - """ - return self._command_json - def marathon_template(self): """Returns raw data from marathon.json @@ -424,18 +414,14 @@ class CosmosPackageVersion(): return self._command_json is not None - def command_json(self, options): - """Returns the JSON content of the command.json template, after - rendering it with options. + def command_json(self): + """Returns the JSON content of the command.json file. - :param options: the template options to use in rendering - :type options: dict :returns: Package data :rtype: dict """ - rendered = pystache.render(json.dumps(self._command_json), options) - return util.load_jsons(rendered) + return self._command_json def package_versions(self): """Returns a list of available versions for this package diff --git a/dcos/subcommand.py b/dcos/subcommand.py index 5532f9b..e8900d4 100644 --- a/dcos/subcommand.py +++ b/dcos/subcommand.py @@ -231,7 +231,7 @@ def _install_env(pkg, options): pkg_dir = _package_dir(pkg.name()) - install_operation = pkg.command_json(options) + install_operation = pkg.command_json() env_dir = os.path.join(pkg_dir, constants.DCOS_SUBCOMMAND_VIRTUALENV_SUBDIR)