'NoneType' object has no attribute 'service_catalog' 报错
编辑:/etc/keystone/keystone-paste.ini
在[pipeline:public_api], [pipeline:admin_api], and [pipeline:api_v3] 三个地方
移走:admin_token_auth
为了安全设置,需要移除认证中的 token相关的认证,可以移除之后,使用admin进行验证的时候报错:
[root@controller01 ~]# openstack --os-auth-url http://controller01:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token
issue'NoneType' object has no attribute 'service_catalog'
研究后发现是之前在使用token的时候,定义了系统的环境变量,移除后再试就好了:
操作如下:
[root@controller01 ~]# unset OS_TOKEN
[root@controller01 ~]# unset OS_URL
[root@controller01 ~]# unset OS_IDENTITY_API_VERSION
[root@controller01 ~]# echo ${OS_TOKEN}
[root@controller01 ~]# openstack --os-auth-url http://controller01:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token
issuePassword:
+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires | 2018-09-20T05:56:24.000000Z |
| id | gAAAAABboyh4wJ_l0suMnuQCThCwAF2xLWD5Yl5_HjhHuAa5lkTC5JK8eC8-Hli4olfo3XIlR0AulIbC46r- |
| | tsq6WgRjpa65RrD_6rtCL_gigsIXRRUEBFR1apJiiE8SE_KSIInLqd9SCui4lje2s9i__RcnTA6JPGwkN9BXYjcfpjAkZHgNHtY |
| project_id | cec3ca49340b4d15b623edff7234cfe5 |
| user_id | 217f8594d6574801b7c52a56cf0a9a51 |
+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+