From 994be740d4709539f0f598e22658aa1785f4c6d2 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sat, 19 Oct 2013 11:02:17 +1100 Subject: [PATCH] Change deprecated CLI arguments According to keystoneclient/shell.py, --token and --endpoint (with their accompanying ENV vars SERVICE_TOKEN and SERVICE_ENDPOINT) were retained only for Essex compatibility and should have been removed during Grizzly, replaced with --os-token (OS_SERVICE_TOKEN) and --os-endpoint (OS_SERVICE_ENDPOINT). This patch updates a couple of doc references to the old options, and the sample_data tool. Change-Id: I87060764f40b1612e3a440c3406d094536af4c9c --- doc/source/configuration.rst | 26 +++++++++++++------------- doc/source/developing.rst | 4 ++-- tools/sample_data.sh | 12 ++++++------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 987c4aaddd..23925c0020 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -724,7 +724,7 @@ To test this, you should now be able to start ``keystone-all`` and use the Keystone Client to list your tenants (which should successfully return an empty list from your new database):: - $ keystone --token ADMIN --endpoint http://127.0.0.1:35357/v2.0/ tenant-list + $ keystone --os-token ADMIN --os-endpoint http://127.0.0.1:35357/v2.0/ tenant-list +----+------+---------+ | id | name | enabled | +----+------+---------+ @@ -732,10 +732,10 @@ empty list from your new database):: .. NOTE:: - We're providing the default SERVICE_TOKEN and SERVICE_ENDPOINT values from - ``keystone.conf`` to connect to the Keystone service. If you changed those - values, or deployed Keystone to a different endpoint, you will need to - change the provided command accordingly. + We're providing the default OS_SERVICE_TOKEN and OS_SERVICE_ENDPOINT values + from ``keystone.conf`` to connect to the Keystone service. If you changed + those values, or deployed Keystone to a different endpoint, you will need + to change the provided command accordingly. Initializing Keystone ===================== @@ -773,9 +773,9 @@ Authenticating with a Token To use Keystone with a token, set the following flags: -* ``--endpoint SERVICE_ENDPOINT``: allows you to specify the Keystone endpoint +* ``--os-endpoint OS_SERVICE_ENDPOINT``: allows you to specify the Keystone endpoint to communicate with. The default endpoint is ``http://localhost:35357/v2.0`` -* ``--token SERVICE_TOKEN``: your service token +* ``--os-token OS_SERVICE_TOKEN``: your service token To administer a Keystone endpoint, your token should be either belong to a user with the ``admin`` role, or, if you haven't created one yet, should be equal to @@ -784,8 +784,8 @@ the value defined by ``[DEFAULT] admin_token`` in your ``keystone.conf``. You can also set these variables in your environment so that they do not need to be passed as arguments each time:: - $ export SERVICE_ENDPOINT=http://localhost:35357/v2.0 - $ export SERVICE_TOKEN=ADMIN + $ export OS_SERVICE_ENDPOINT=http://localhost:35357/v2.0 + $ export OS_SERVICE_TOKEN=ADMIN Authenticating with a Password ------------------------------ @@ -880,14 +880,14 @@ provide additional (often optional) information. For example, the command ``user-list`` and ``tenant-create`` can be invoked as follows:: # Using token auth env variables - export SERVICE_ENDPOINT=http://127.0.0.1:35357/v2.0/ - export SERVICE_TOKEN=secrete_token + export OS_SERVICE_ENDPOINT=http://127.0.0.1:35357/v2.0/ + export OS_SERVICE_TOKEN=secrete_token keystone user-list keystone tenant-create --name=demo # Using token auth flags - keystone --token=secrete --endpoint=http://127.0.0.1:35357/v2.0/ user-list - keystone --token=secrete --endpoint=http://127.0.0.1:35357/v2.0/ tenant-create --name=demo + keystone --os-token=secrete --os-endpoint=http://127.0.0.1:35357/v2.0/ user-list + keystone --os-token=secrete --os-endpoint=http://127.0.0.1:35357/v2.0/ tenant-create --name=demo # Using user + password + tenant_name env variables export OS_USERNAME=admin diff --git a/doc/source/developing.rst b/doc/source/developing.rst index c9ff4ca7f4..b575a4bb34 100644 --- a/doc/source/developing.rst +++ b/doc/source/developing.rst @@ -109,7 +109,7 @@ Initial Sample Data There is an included script which is helpful in setting up some initial sample data for use with keystone:: - $ SERVICE_TOKEN=ADMIN tools/with_venv.sh tools/sample_data.sh + $ OS_SERVICE_TOKEN=ADMIN tools/with_venv.sh tools/sample_data.sh Notice it requires a service token read from an environment variable for authentication. The default value "ADMIN" is from the ``admin_token`` @@ -118,7 +118,7 @@ option in the ``[DEFAULT]`` section in ``etc/keystone.conf``. Once run, you can see the sample data that has been created by using the `python-keystoneclient`_ command-line interface:: - $ tools/with_venv.sh keystone --token ADMIN --endpoint http://127.0.0.1:35357/v2.0/ user-list + $ tools/with_venv.sh keystone --os-token ADMIN --os-endpoint http://127.0.0.1:35357/v2.0/ user-list Running Tests ============= diff --git a/tools/sample_data.sh b/tools/sample_data.sh index d09502d68e..a9bf50483a 100755 --- a/tools/sample_data.sh +++ b/tools/sample_data.sh @@ -19,8 +19,8 @@ # This script is based on the original DevStack keystone_data.sh script. # # It demonstrates how to bootstrap Keystone with an administrative user -# using the SERVICE_TOKEN and SERVICE_ENDPOINT environment variables -# and the administrative API. It will get the admin_token (SERVICE_TOKEN) +# using the OS_SERVICE_TOKEN and OS_SERVICE_ENDPOINT environment variables +# and the administrative API. It will get the admin_token (OS_SERVICE_TOKEN) # and admin_port from keystone.conf if available. # # Disable creation of endpoints by setting DISABLE_ENDPOINTS environment variable. @@ -71,14 +71,14 @@ if [[ -r "$KEYSTONE_CONF" ]]; then CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2) fi -export SERVICE_TOKEN=${SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN} -if [[ -z "$SERVICE_TOKEN" ]]; then +export OS_SERVICE_TOKEN=${OS_SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN} +if [[ -z "$OS_SERVICE_TOKEN" ]]; then echo "No service token found." - echo "Set SERVICE_TOKEN manually from keystone.conf admin_token." + echo "Set OS_SERVICE_TOKEN manually from keystone.conf admin_token." exit 1 fi -export SERVICE_ENDPOINT=${SERVICE_ENDPOINT:-http://$CONTROLLER_PUBLIC_ADDRESS:${CONFIG_ADMIN_PORT:-35357}/v2.0} +export OS_SERVICE_ENDPOINT=${OS_SERVICE_ENDPOINT:-http://$CONTROLLER_PUBLIC_ADDRESS:${CONFIG_ADMIN_PORT:-35357}/v2.0} function get_id () { echo `"$@" | grep ' id ' | awk '{print $4}'`