Change tenant to project in docs and unit tests
Change os_tenant_name to os_project_name in documentation, client and shell unit tests. This is follow-up change augmenting the patch https://review.openstack.org/#/c/408235/ for consistency. Change-Id: Iaea3ddc71dadc2991e56667988df82aa1cfaf525 Related-Bug: #1646837
This commit is contained in:
@@ -49,7 +49,7 @@ the ``--os-tenant-name``, ``--os-username``, ``--os-password`` and
|
|||||||
``--os-auth-url`` parameters, though it may be easier to set them
|
``--os-auth-url`` parameters, though it may be easier to set them
|
||||||
as environment variables::
|
as environment variables::
|
||||||
|
|
||||||
$ export OS_TENANT_NAME=project
|
$ export OS_PROJECT_NAME=project
|
||||||
$ export OS_USERNAME=user
|
$ export OS_USERNAME=user
|
||||||
$ export OS_PASSWORD=pass
|
$ export OS_PASSWORD=pass
|
||||||
$ export OS_AUTH_URL=http://auth.example.com:5000/v2.0
|
$ export OS_AUTH_URL=http://auth.example.com:5000/v2.0
|
||||||
|
@@ -68,7 +68,7 @@ To create a client, you can use the API like so::
|
|||||||
>>> kwargs = {'os_username': 'name',
|
>>> kwargs = {'os_username': 'name',
|
||||||
>>> 'os_password': 'password',
|
>>> 'os_password': 'password',
|
||||||
>>> 'os_auth_url': 'http://keystone.example.org:5000/',
|
>>> 'os_auth_url': 'http://keystone.example.org:5000/',
|
||||||
>>> 'os_tenant_name': 'tenant'}
|
>>> 'os_project_name': 'project'}
|
||||||
>>> ironic = client.get_client(1, **kwargs)
|
>>> ironic = client.get_client(1, **kwargs)
|
||||||
|
|
||||||
Perform ironic operations
|
Perform ironic operations
|
||||||
|
@@ -30,8 +30,8 @@ environment variables::
|
|||||||
|
|
||||||
$ export OS_USERNAME=user
|
$ export OS_USERNAME=user
|
||||||
$ export OS_PASSWORD=password
|
$ export OS_PASSWORD=password
|
||||||
$ export OS_TENANT_ID=b363706f891f48019483f8bd6503c54b # or OS_TENANT_NAME
|
$ export OS_PROJECT_ID=b363706f891f48019483f8bd6503c54b # or OS_PROJECT_NAME
|
||||||
$ export OS_TENANT_NAME=project # or OS_TENANT_ID
|
$ export OS_PROJECT_NAME=project # or OS_PROJECT_ID
|
||||||
$ export OS_AUTH_URL=http://auth.example.com:5000/v2.0
|
$ export OS_AUTH_URL=http://auth.example.com:5000/v2.0
|
||||||
|
|
||||||
The command-line tool will attempt to reauthenticate using the provided
|
The command-line tool will attempt to reauthenticate using the provided
|
||||||
|
@@ -68,7 +68,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_get_client_no_auth_token(self):
|
def test_get_client_no_auth_token(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_password': 'PASSWORD',
|
'os_password': 'PASSWORD',
|
||||||
'os_auth_url': 'http://localhost:35357/v2.0',
|
'os_auth_url': 'http://localhost:35357/v2.0',
|
||||||
@@ -78,7 +78,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_get_client_service_and_endpoint_type_defaults(self):
|
def test_get_client_service_and_endpoint_type_defaults(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_password': 'PASSWORD',
|
'os_password': 'PASSWORD',
|
||||||
'os_auth_url': 'http://localhost:35357/v2.0',
|
'os_auth_url': 'http://localhost:35357/v2.0',
|
||||||
@@ -90,7 +90,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_get_client_with_region_no_auth_token(self):
|
def test_get_client_with_region_no_auth_token(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_password': 'PASSWORD',
|
'os_password': 'PASSWORD',
|
||||||
'os_region_name': 'REGIONONE',
|
'os_region_name': 'REGIONONE',
|
||||||
@@ -101,7 +101,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_get_client_no_url(self):
|
def test_get_client_no_url(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_password': 'PASSWORD',
|
'os_password': 'PASSWORD',
|
||||||
'os_auth_url': '',
|
'os_auth_url': '',
|
||||||
@@ -114,7 +114,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_get_client_incorrect_auth_params(self):
|
def test_get_client_incorrect_auth_params(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_auth_url': 'http://localhost:35357/v2.0',
|
'os_auth_url': 'http://localhost:35357/v2.0',
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_get_client_with_api_version_latest(self):
|
def test_get_client_with_api_version_latest(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_password': 'PASSWORD',
|
'os_password': 'PASSWORD',
|
||||||
'os_auth_url': 'http://localhost:35357/v2.0',
|
'os_auth_url': 'http://localhost:35357/v2.0',
|
||||||
@@ -134,7 +134,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
|
|
||||||
def test_get_client_with_api_version_numeric(self):
|
def test_get_client_with_api_version_numeric(self):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_password': 'PASSWORD',
|
'os_password': 'PASSWORD',
|
||||||
'os_auth_url': 'http://localhost:35357/v2.0',
|
'os_auth_url': 'http://localhost:35357/v2.0',
|
||||||
@@ -148,7 +148,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
# Make sure we don't coincidentally succeed
|
# Make sure we don't coincidentally succeed
|
||||||
self.assertNotEqual(v1.DEFAULT_VER, version)
|
self.assertNotEqual(v1.DEFAULT_VER, version)
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'os_tenant_name': 'TENANT_NAME',
|
'os_project_name': 'PROJECT_NAME',
|
||||||
'os_username': 'USERNAME',
|
'os_username': 'USERNAME',
|
||||||
'os_password': 'PASSWORD',
|
'os_password': 'PASSWORD',
|
||||||
'os_auth_url': 'http://localhost:35357/v2.0',
|
'os_auth_url': 'http://localhost:35357/v2.0',
|
||||||
@@ -237,7 +237,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
passed_kwargs = {
|
passed_kwargs = {
|
||||||
'os_auth_url': 'http://localhost:35357/v3',
|
'os_auth_url': 'http://localhost:35357/v3',
|
||||||
'os_region_name': 'REGIONONE',
|
'os_region_name': 'REGIONONE',
|
||||||
'os_tenant_name': 'TENANT',
|
'os_project_name': 'PROJECT',
|
||||||
'os_username': 'user',
|
'os_username': 'user',
|
||||||
'os_password': '1234',
|
'os_password': '1234',
|
||||||
'os_project_domain_id': 'DEFAULT',
|
'os_project_domain_id': 'DEFAULT',
|
||||||
@@ -246,7 +246,7 @@ class ClientTest(utils.BaseTestCase):
|
|||||||
expected_kwargs = {
|
expected_kwargs = {
|
||||||
'auth_url': 'http://localhost:35357/v3',
|
'auth_url': 'http://localhost:35357/v3',
|
||||||
'project_id': None,
|
'project_id': None,
|
||||||
'project_name': 'TENANT',
|
'project_name': 'PROJECT',
|
||||||
'user_domain_id': 'DEFAULT',
|
'user_domain_id': 'DEFAULT',
|
||||||
'user_domain_name': None,
|
'user_domain_name': None,
|
||||||
'project_domain_id': 'DEFAULT',
|
'project_domain_id': 'DEFAULT',
|
||||||
|
@@ -35,20 +35,20 @@ V3_URL = BASE_URL + '/v3'
|
|||||||
|
|
||||||
FAKE_ENV = {'OS_USERNAME': 'username',
|
FAKE_ENV = {'OS_USERNAME': 'username',
|
||||||
'OS_PASSWORD': 'password',
|
'OS_PASSWORD': 'password',
|
||||||
'OS_TENANT_NAME': 'tenant_name',
|
'OS_PROJECT_NAME': 'project_name',
|
||||||
'OS_AUTH_URL': V2_URL}
|
'OS_AUTH_URL': V2_URL}
|
||||||
|
|
||||||
FAKE_ENV_KEYSTONE_V2 = {
|
FAKE_ENV_KEYSTONE_V2 = {
|
||||||
'OS_USERNAME': 'username',
|
'OS_USERNAME': 'username',
|
||||||
'OS_PASSWORD': 'password',
|
'OS_PASSWORD': 'password',
|
||||||
'OS_TENANT_NAME': 'tenant_name',
|
'OS_PROJECT_NAME': 'project_name',
|
||||||
'OS_AUTH_URL': V2_URL
|
'OS_AUTH_URL': V2_URL
|
||||||
}
|
}
|
||||||
|
|
||||||
FAKE_ENV_KEYSTONE_V3 = {
|
FAKE_ENV_KEYSTONE_V3 = {
|
||||||
'OS_USERNAME': 'username',
|
'OS_USERNAME': 'username',
|
||||||
'OS_PASSWORD': 'password',
|
'OS_PASSWORD': 'password',
|
||||||
'OS_TENANT_NAME': 'tenant_name',
|
'OS_PROJECT_NAME': 'project_name',
|
||||||
'OS_AUTH_URL': V3_URL,
|
'OS_AUTH_URL': V3_URL,
|
||||||
'OS_USER_DOMAIN_ID': 'default',
|
'OS_USER_DOMAIN_ID': 'default',
|
||||||
'OS_PROJECT_DOMAIN_ID': 'default',
|
'OS_PROJECT_DOMAIN_ID': 'default',
|
||||||
@@ -56,7 +56,7 @@ FAKE_ENV_KEYSTONE_V3 = {
|
|||||||
|
|
||||||
FAKE_ENV_KEYSTONE_V2_TOKEN = {
|
FAKE_ENV_KEYSTONE_V2_TOKEN = {
|
||||||
'OS_AUTH_TOKEN': 'admin_token',
|
'OS_AUTH_TOKEN': 'admin_token',
|
||||||
'OS_TENANT_NAME': 'tenant_name',
|
'OS_PROJECT_NAME': 'project_name',
|
||||||
'OS_AUTH_URL': V2_URL
|
'OS_AUTH_URL': V2_URL
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,11 +163,12 @@ class ShellTest(utils.BaseTestCase):
|
|||||||
self.shell, 'node-list')
|
self.shell, 'node-list')
|
||||||
expected_kwargs = {
|
expected_kwargs = {
|
||||||
'ironic_url': '', 'os_auth_url': FAKE_ENV['OS_AUTH_URL'],
|
'ironic_url': '', 'os_auth_url': FAKE_ENV['OS_AUTH_URL'],
|
||||||
'os_tenant_id': '', 'os_tenant_name': FAKE_ENV['OS_TENANT_NAME'],
|
'os_tenant_id': '', 'os_tenant_name': '',
|
||||||
'os_username': FAKE_ENV['OS_USERNAME'], 'os_user_domain_id': '',
|
'os_username': FAKE_ENV['OS_USERNAME'], 'os_user_domain_id': '',
|
||||||
'os_user_domain_name': '', 'os_password': FAKE_ENV['OS_PASSWORD'],
|
'os_user_domain_name': '', 'os_password': FAKE_ENV['OS_PASSWORD'],
|
||||||
'os_auth_token': '', 'os_project_id': '',
|
'os_auth_token': '', 'os_project_id': '',
|
||||||
'os_project_name': '', 'os_project_domain_id': '',
|
'os_project_name': FAKE_ENV['OS_PROJECT_NAME'],
|
||||||
|
'os_project_domain_id': '',
|
||||||
'os_project_domain_name': '', 'os_region_name': '',
|
'os_project_domain_name': '', 'os_region_name': '',
|
||||||
'os_service_type': '', 'os_endpoint_type': '', 'os_cacert': None,
|
'os_service_type': '', 'os_endpoint_type': '', 'os_cacert': None,
|
||||||
'os_cert': None, 'os_key': None,
|
'os_cert': None, 'os_key': None,
|
||||||
@@ -191,11 +192,12 @@ class ShellTest(utils.BaseTestCase):
|
|||||||
'ironic_url': '',
|
'ironic_url': '',
|
||||||
'os_auth_url': FAKE_ENV_KEYSTONE_V2_TOKEN['OS_AUTH_URL'],
|
'os_auth_url': FAKE_ENV_KEYSTONE_V2_TOKEN['OS_AUTH_URL'],
|
||||||
'os_tenant_id': '',
|
'os_tenant_id': '',
|
||||||
'os_tenant_name': FAKE_ENV_KEYSTONE_V2_TOKEN['OS_TENANT_NAME'],
|
'os_tenant_name': '',
|
||||||
'os_username': '', 'os_user_domain_id': '',
|
'os_username': '', 'os_user_domain_id': '',
|
||||||
'os_user_domain_name': '', 'os_password': '',
|
'os_user_domain_name': '', 'os_password': '',
|
||||||
'os_auth_token': FAKE_ENV_KEYSTONE_V2_TOKEN['OS_AUTH_TOKEN'],
|
'os_auth_token': FAKE_ENV_KEYSTONE_V2_TOKEN['OS_AUTH_TOKEN'],
|
||||||
'os_project_id': '', 'os_project_name': '',
|
'os_project_id': '',
|
||||||
|
'os_project_name': FAKE_ENV_KEYSTONE_V2_TOKEN['OS_PROJECT_NAME'],
|
||||||
'os_project_domain_id': '', 'os_project_domain_name': '',
|
'os_project_domain_id': '', 'os_project_domain_name': '',
|
||||||
'os_region_name': '', 'os_service_type': '',
|
'os_region_name': '', 'os_service_type': '',
|
||||||
'os_endpoint_type': '', 'os_cacert': None, 'os_cert': None,
|
'os_endpoint_type': '', 'os_cacert': None, 'os_cert': None,
|
||||||
@@ -255,8 +257,8 @@ class ShellTest(utils.BaseTestCase):
|
|||||||
class TestCase(testtools.TestCase):
|
class TestCase(testtools.TestCase):
|
||||||
|
|
||||||
def set_fake_env(self, fake_env):
|
def set_fake_env(self, fake_env):
|
||||||
client_env = ('OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_ID',
|
client_env = ('OS_USERNAME', 'OS_PASSWORD', 'OS_PROJECT_ID',
|
||||||
'OS_TENANT_NAME', 'OS_AUTH_URL', 'OS_REGION_NAME',
|
'OS_PROJECT_NAME', 'OS_AUTH_URL', 'OS_REGION_NAME',
|
||||||
'OS_AUTH_TOKEN', 'OS_NO_CLIENT_AUTH', 'OS_SERVICE_TYPE',
|
'OS_AUTH_TOKEN', 'OS_NO_CLIENT_AUTH', 'OS_SERVICE_TYPE',
|
||||||
'OS_ENDPOINT_TYPE', 'OS_CACERT', 'OS_CERT', 'OS_KEY')
|
'OS_ENDPOINT_TYPE', 'OS_CACERT', 'OS_CERT', 'OS_KEY')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user