Merge pull request #526 from mesosphere/deprecation-notices

add deprecation notices for `package update`, `package.sources` property
This commit is contained in:
tamarrow
2016-03-10 18:05:34 -08:00
6 changed files with 41 additions and 0 deletions

View File

@@ -94,6 +94,10 @@ def _set(name, value):
:rtype: int
"""
if name == "package.sources":
notice = ("This config property has been deprecated. "
"Please add your repositories with `dcos package repo add`")
return DCOSException(notice)
toml_config = config.set_val(name, value)
if (name == 'core.reporting' is True) or (name == 'core.email'):
analytics.segment_identify(toml_config)

View File

@@ -21,6 +21,7 @@ Usage:
dcos package repo list [--json]
dcos package uninstall [--cli | [--app --app-id=<app-id> --all]]
<package-name>
dcos package update
Options:
--all

View File

@@ -53,6 +53,11 @@ def _cmds():
"""
return [
cmds.Command(
hierarchy=['package', 'update'],
arg_keys=[],
function=_update),
cmds.Command(
hierarchy=['package', 'repo', 'list'],
arg_keys=['--json'],
@@ -138,6 +143,19 @@ def _info():
return 0
def _update():
"""
:returns: Deprecation notice
:rtype: str
"""
_get_package_manager()
notice = ("This command has been deprecated. "
"Repositories will be automatically updated after they are added"
" by `dcos package repo add`")
raise DCOSException(notice)
def _list_repos(is_json):
"""List configured package repositories.

View File

@@ -21,6 +21,7 @@ Usage:
dcos package repo list [--json]
dcos package uninstall [--cli | [--app --app-id=<app-id> --all]]
<package-name>
dcos package update
Options:
--all

View File

@@ -102,6 +102,14 @@ def test_get_top_property(env):
returncode=1)
def test_set_package_sources_property(env):
notice = (b"This config property has been deprecated. "
b"Please add your repositories with `dcos package repo add`\n")
assert_command(['dcos', 'config', 'set', 'package.sources', '[\"foo\"]'],
stderr=notice,
returncode=1)
def test_set_existing_string_property(env):
config_set('core.dcos_url',
'http://dcos.snakeoil.mesosphere.com:5081', env)

View File

@@ -52,6 +52,15 @@ def test_version():
stdout=b'dcos-package version SNAPSHOT\n')
def test_update_deprecation_notice():
notice = (b"This command has been deprecated. "
b"Repositories will be automatically updated after they are"
b" added by `dcos package repo add`\n")
assert_command(['dcos', 'package', 'update'],
stderr=notice,
returncode=1)
def test_repo_list():
repo_list = b"""\
test4: https://github.com/mesosphere/universe/archive/cli-test-4.zip