Skip to content

Commit

Permalink
Merge pull request #478 from mesosphere/bugfix
Browse files Browse the repository at this point in the history
check for cosmos in each `package` subcommand call
  • Loading branch information
tamarrow committed Feb 18, 2016
2 parents 3012004 + 82c86aa commit 70b8a1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/dcoscli/package/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def _main():
version='dcos-package version {}'.format(dcoscli.version))
http.silence_requests_warnings()

_check_cluster_capabilities()
return cmds.execute(_cmds(), args)


Expand Down Expand Up @@ -142,6 +141,7 @@ def _list_sources():
:rtype: int
"""

_check_cluster_capabilities()
config = util.get_config()

sources = package.list_sources(config)
Expand All @@ -161,6 +161,7 @@ def _update(validate):
:rtype: int
"""

_check_cluster_capabilities()
config = util.get_config()

package.update_sources(config, validate)
Expand Down Expand Up @@ -201,6 +202,7 @@ def _describe(package_name,
:rtype: int
"""

_check_cluster_capabilities()
# If the user supplied template options, they definitely want to
# render the template
if options_path:
Expand Down Expand Up @@ -325,6 +327,7 @@ def _install(package_name, package_version, options_path, app_id, cli, app,
:rtype: int
"""

_check_cluster_capabilities()
if cli is False and app is False:
# Install both if neither flag is specified
cli = app = True
Expand Down Expand Up @@ -422,6 +425,7 @@ def _list(json_, endpoints, app_id, package_name):
:rtype: int
"""

_check_cluster_capabilities()
config = util.get_config()
init_client = marathon.create_client(config)
installed = package.installed_packages(init_client, endpoints)
Expand Down Expand Up @@ -488,6 +492,8 @@ def _search(json_, query):
:returns: Process status
:rtype: int
"""

_check_cluster_capabilities()
if not query:
query = ''

Expand Down Expand Up @@ -518,6 +524,7 @@ def _uninstall(package_name, remove_all, app_id, cli, app):
:rtype: int
"""

_check_cluster_capabilities()
err = package.uninstall(package_name, remove_all, app_id, cli, app)
if err is not None:
emitter.publish(err)
Expand Down

0 comments on commit 70b8a1a

Please sign in to comment.