Rename the dcos_uri config value to dcos_url

This commit is contained in:
José Armando García Sancio
2015-05-18 12:22:11 -07:00
parent 0a0ffb3c81
commit 7cc7fb66df
10 changed files with 36 additions and 36 deletions

View File

@@ -51,7 +51,7 @@ Configure Environment and Run
#. Configure Marathon, changing the values below as appropriate for your local
installation::
dcos config set marathon.uri http://localhost:8080
dcos config set marathon.url http://localhost:8080
dcos config append package.sources https://github.com/mesosphere/universe/archive/master.zip
dcos config set package.cache /tmp/dcos
dcos package update

View File

@@ -3,7 +3,7 @@ param([Parameter(Mandatory=$true,ValueFromPipeline=$true)]
$installation_path,
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]
$dcos_uri
$dcos_url
)
if (-Not(Get-Command python -errorAction SilentlyContinue))
@@ -92,7 +92,7 @@ if (-Not(Test-Path $DCOS_CONFIG)) {
$env:DCOS_CONFIG = $DCOS_CONFIG
dcos config set core.reporting true
dcos config set core.dcos_uri $dcos_uri
dcos config set core.dcos_url $dcos_url
dcos config set package.cache $env:temp\dcos\package-cache
dcos config set package.sources '[\"https://github.com/mesosphere/universe/archive/master.zip\"]'

View File

@@ -4,7 +4,7 @@ set -o errexit -o pipefail
usage()
{ # Show usage information.
echo "$(basename "$(test -L "$0" && readlink "$0" || echo "$0")") <installation-path> <dcos-uri>"
echo "$(basename "$(test -L "$0" && readlink "$0" || echo "$0")") <installation-path> <dcos-url>"
}
if [ "$#" -lt 2 ]; then
@@ -15,7 +15,7 @@ fi
ARGS=( "$@" );
VIRTUAL_ENV_PATH=$(python -c "import os; print(os.path.realpath('"${ARGS[0]}"'))")
DCOS_URI=${ARGS[1]}
DCOS_URL=${ARGS[1]}
command -v virtualenv >/dev/null 2>&1 || { echo "Cannot find virtualenv. Aborting."; exit 1; }
@@ -45,7 +45,7 @@ fi
ENV_SETUP="$VIRTUAL_ENV_PATH/bin/env-setup"
source "$ENV_SETUP"
dcos config set core.reporting true
dcos config set core.dcos_uri $DCOS_URI
dcos config set core.dcos_url $DCOS_URL
dcos config set package.cache ~/.dcos/cache
dcos config set package.sources '["https://github.com/mesosphere/universe/archive/master.zip"]'
dcos package update

View File

@@ -387,7 +387,7 @@ def _get_config_schema(command):
def _split_key(name):
"""
:param name: the full property path - e.g. marathon.uri
:param name: the full property path - e.g. marathon.url
:type name: str
:returns: the section and property name
:rtype: (str, str)
@@ -396,7 +396,7 @@ def _split_key(name):
terms = name.split('.', 1)
if len(terms) != 2:
raise DCOSException('Property name must have both a section and '
'key: <section>.<key> - E.g. marathon.uri')
'key: <section>.<key> - E.g. marathon.url')
return (terms[0], terms[1])

View File

@@ -7,10 +7,10 @@
"title": "Your email address",
"description": "Your email address"
},
"dcos_uri": {
"dcos_url": {
"type": "string",
"title": "DCOS URI",
"description": "The URI to the location of the DCOS"
"title": "DCOS URL",
"description": "The URL to the location of the DCOS"
},
"refresh_token": {
"type": "string",

View File

@@ -2,10 +2,10 @@
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"uri": {
"url": {
"type": "string",
"title": "Marathon base URI",
"description": "Base URI for talking to Marathon. It overwrites the value specified in core.dcos_uri",
"title": "Marathon base URL",
"description": "Base URL for talking to Marathon. It overwrites the value specified in core.dcos_url",
"default": "http://localhost:8080"
}
},

View File

@@ -3,7 +3,7 @@ mesos_master_url = "http://localhost:5050"
reporting = false
email = "test@mail.com"
[marathon]
uri = "http://localhost:8080"
url = "http://localhost:8080"
[package]
sources = [ "git://github.com/mesosphere/universe.git", "https://github.com/mesosphere/universe/archive/master.zip",]
cache = "tmp/cache"

View File

@@ -70,7 +70,7 @@ def test_list_property(env):
stdout = b"""core.email=test@mail.com
core.mesos_master_url=http://localhost:5050
core.reporting=False
marathon.uri=http://localhost:8080
marathon.url=http://localhost:8080
package.cache=tmp/cache
package.sources=['git://github.com/mesosphere/universe.git', \
'https://github.com/mesosphere/universe/archive/master.zip']
@@ -81,7 +81,7 @@ package.sources=['git://github.com/mesosphere/universe.git', \
def test_get_existing_string_property(env):
_get_value('marathon.uri', 'http://localhost:8080', env)
_get_value('marathon.url', 'http://localhost:8080', env)
def test_get_existing_boolean_property(env):
@@ -106,9 +106,9 @@ def test_get_top_property(env):
def test_set_existing_string_property(env):
_set_value('marathon.uri', 'http://newhost:8081', env)
_get_value('marathon.uri', 'http://newhost:8081', env)
_set_value('marathon.uri', 'http://localhost:8080', env)
_set_value('marathon.url', 'http://newhost:8081', env)
_get_value('marathon.url', 'http://newhost:8081', env)
_set_value('marathon.url', 'http://localhost:8080', env)
def test_set_existing_boolean_property(env):
@@ -188,22 +188,22 @@ def test_prepend_list(env):
def test_append_non_list(env):
stderr = (b"Append/Prepend not supported on 'marathon.uri' "
b"properties - use 'dcos config set marathon.uri new_uri'\n")
stderr = (b"Append/Prepend not supported on 'marathon.url' "
b"properties - use 'dcos config set marathon.url new_uri'\n")
assert_command(
['dcos', 'config', 'append', 'marathon.uri', 'new_uri'],
['dcos', 'config', 'append', 'marathon.url', 'new_uri'],
returncode=1,
stderr=stderr,
env=env)
def test_prepend_non_list(env):
stderr = (b"Append/Prepend not supported on 'marathon.uri' "
b"properties - use 'dcos config set marathon.uri new_uri'\n")
stderr = (b"Append/Prepend not supported on 'marathon.url' "
b"properties - use 'dcos config set marathon.url new_uri'\n")
assert_command(
['dcos', 'config', 'prepend', 'marathon.uri', 'new_uri'],
['dcos', 'config', 'prepend', 'marathon.url', 'new_uri'],
returncode=1,
stderr=stderr,
env=env)
@@ -285,7 +285,7 @@ def test_unset_index_from_string(env):
stderr = b'Unsetting based on an index is only supported for lists\n'
assert_command(
['dcos', 'config', 'unset', '--index=0', 'marathon.uri'],
['dcos', 'config', 'unset', '--index=0', 'marathon.url'],
returncode=1,
stderr=stderr,
env=env)
@@ -319,9 +319,9 @@ def test_set_property_key(env):
def test_set_missing_property(missing_env):
_set_value('marathon.uri', 'http://localhost:8080', missing_env)
_get_value('marathon.uri', 'http://localhost:8080', missing_env)
_unset_value('marathon.uri', None, missing_env)
_set_value('marathon.url', 'http://localhost:8080', missing_env)
_get_value('marathon.url', 'http://localhost:8080', missing_env)
_unset_value('marathon.url', None, missing_env)
def test_set_core_property(env):

View File

@@ -605,10 +605,10 @@ def test_show_task():
def test_bad_configuration():
show_returncode, show_stdout, stderr = exec_command(
['dcos', 'config', 'show', 'marathon.uri'])
['dcos', 'config', 'show', 'marathon.url'])
assert_command(
['dcos', 'config', 'set', 'marathon.uri', 'http://localhost:88888'])
['dcos', 'config', 'set', 'marathon.url', 'http://localhost:88888'])
returncode, stdout, stderr = exec_command(
['dcos', 'marathon', 'app', 'list'])
@@ -621,9 +621,9 @@ def test_bad_configuration():
if show_returncode == 0:
url = show_stdout.decode('utf-8').strip()
assert_command(['dcos', 'config', 'set', 'marathon.uri', url])
assert_command(['dcos', 'config', 'set', 'marathon.url', url])
else:
assert_command(['dcos', 'config', 'unset', 'marathon.uri'])
assert_command(['dcos', 'config', 'unset', 'marathon.url'])
def _list_apps(app_id=None):

View File

@@ -35,9 +35,9 @@ def _get_marathon_uri(config):
:rtype: str
"""
marathon_uri = config.get('marathon.uri')
marathon_uri = config.get('marathon.url')
if marathon_uri is None:
marathon_uri = config.get('core.dcos_uri')
marathon_uri = config.get('core.dcos_url')
if marathon_uri is None:
raise DCOSException(_default_marathon_error())