怎样解决CRITICAL glance [-] AttributeError: 'NoneType' object has no attribute 'drivername'

怎样解决CRITICAL glance [-] AttributeError: 'NoneType' object has no attribute 'drivername'

今天在配置OpenStack的Glance时。前边进行的都非常顺利。当作到这一步时sudo glance-manage db_sync时出现了例如以下错误
怎样解决CRITICAL glance [-] AttributeError: 'NoneType' object has no attribute 'drivername'
依据错误提示,想到可能是配置问题。于是就查找了配置文档,发现须要在/etc/glance/glance-registry.conf和/etc/glance/glance-api.conf中增加以下一句话

sql_connection = mysql://glance:GLANCE_DBPASS@controller/glance

格式例如以下:sql_connection = mysql://USER:PASSWORD@HOST/DBNAME

然后又一次运行命令,却又出现例如以下的错误
怎样解决CRITICAL glance [-] AttributeError: 'NoneType' object has no attribute 'drivername'
是由于MySQL-python没有安装,运行pip install MySQL-python进行安装
再次运行命令。出现例如以下情况:
怎样解决CRITICAL glance [-] AttributeError: 'NoneType' object has no attribute 'drivername'
是数据库中的一个表没有设置行UTF-8的格式,依照以下的方式进行设置
怎样解决CRITICAL glance [-] AttributeError: 'NoneType' object has no attribute 'drivername'
再次运行命令,最终成功了!!!