Ask Your Question
0

'NoneType' object has no attribute '__getitem__'??

asked 2013-12-09 07:13:27 -0500

mantri.arjun@hotmail.com gravatar image

BELOW IS MY KEYSTONE FILE WHICH I GOT FROM:-https://raw.github.com/mseknibilel/OpenStack-Grizzly-Install-Guide/master/KeystoneScripts/keystone_basic.sh

#!/bin/sh #

Keystone basic configuration

Mainly inspired by https://github.com/openstack/keystone/blob/master/tools/sample_data.sh

Modified by Bilel Msekni / Institut Telecom

#

Support: openstack@lists.launchpad.net

License: Apache Software License (ASL) 2.0

# HOST_IP=10.10.100.51 ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin_pass} SERVICE_PASSWORD=${SERVICE_PASSWORD:-service_pass} export SERVICE_TOKEN="ADMIN" export SERVICE_ENDPOINT="http://${HOST_IP}:35357/v2.0" SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}

get_id () { echo $@ | awk '/ id / { print $4 }' }

Tenants

ADMIN_TENANT=$(get_id keystone tenant-create --name=admin) SERVICE_TENANT=$(get_id keystone tenant-create --name=$SERVICE_TENANT_NAME)

Users

ADMIN_USER=$(get_id keystone user-create --name=admin --pass="$ADMIN_PASSWORD" --email=admin@domain.com )

Roles

ADMIN_ROLE=$(get_id keystone role-create --name=admin) KEYSTONEADMIN_ROLE=$(get_id keystone role-create --name=KeystoneAdmin) KEYSTONESERVICE_ROLE=$(get_id keystone role-create --name=KeystoneServiceAdmin)

Add Roles to Users in Tenants

keystone user-role-add --user-id $ADMIN_USER --role-id $ADMIN_ROLE --tenant-id $ADMIN_TENANT keystone user-role-add --user-id $ADMIN_USER --role-id $KEYSTONEADMIN_ROLE --tenant-id $ADMIN_TENANT keystone user-role-add --user-id $ADMIN_USER --role-id $KEYSTONESERVICE_ROLE --tenant-id $ADMIN_TENANT

The Member role is used by Horizon and Swift

MEMBER_ROLE=$(get_id keystone role-create --name=Member)

Configure service users/roles

NOVA_USER=$(get_id keystone user-create --name=nova --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=nova@domain.com ) keystone user-role-add --tenant-id $SERVICE_TENANT --user-id $NOVA_USER --role-id $ADMIN_ROLE

GLANCE_USER=$(get_id keystone user-create --name=glance --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=glance@domain.com ) keystone user-role-add --tenant-id $SERVICE_TENANT --user-id $GLANCE_USER --role-id $ADMIN_ROLE

QUANTUM_USER=$(get_id keystone user-create --name=quantum --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=quantum@domain.com ) keystone user-role-add --tenant-id $SERVICE_TENANT --user-id $QUANTUM_USER --role-id $ADMIN_ROLE

CINDER_USER=$(get_id keystone user-create --name=cinder --pass="$SERVICE_PASSWORD" --tenant-id $SERVICE_TENANT --email=cinder@domain.com ) keystone user-role-add --tenant-id $SERVICE_TENANT --user-id $CINDER_USER --role-id $ADMIN_ROLE

WHEN I RUN IT I GET

'NoneType' object has no attribute '__getitem__' 'NoneType' object has no attribute '__getitem__' 'NoneType' object has no attribute '__getitem__' 'NoneType' object has no attribute '__getitem__' 'NoneType' object has no attribute '__getitem__' 'NoneType' object has no attribute '__getitem__' usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>] keystone user-role-add: error: argument --user/--user-id/--user_id: expected one argument usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>] keystone user-role-add: error: argument --user/--user-id/--user_id: expected one argument usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>] keystone user-role-add: error: argument --user/--user-id/--user_id: expected one argument 'NoneType' object has no attribute '__getitem__' usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>] [--pass <pass>] [--email <email>] [--enabled <true|false>] keystone user-create: error: argument --tenant-id: expected one argument usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>] keystone user-role-add: error: argument --tenant/--tenant-id: expected one argument usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>] [--pass <pass>] [--email <email>] [--enabled <true|false>] keystone user-create: error: argument --tenant-id: expected one argument usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>] keystone user-role-add: error: argument --tenant/--tenant-id: expected one argument usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>] [--pass <pass>] [--email <email>] [--enabled <true|false>] keystone user-create: error: argument --tenant-id: expected one argument usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>] keystone user-role-add: error: argument --tenant/--tenant-id: expected one argument usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>] [--pass ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-02-03 13:10:43 -0500

koolhead17 gravatar image

What version of OpenStack are you installing?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-12-09 07:13:27 -0500

Seen: 1,027 times

Last updated: Feb 03 '14