if you're using Nova but don't have Nova configured with
auth_strategy='keystone' (see nova.image.glance._create_glance_client for details),
and when you resize(or other operation need call glance) an VM, it may call
glanceclient, and code may go to the logic like:
/usr/lib/python2.7/site-packages/glanceclient/v1/client.py(36)__init__()
-> self.http_client = http.HTTPClient(endpoint, *args, **kwargs)
> /usr/lib/python2.7/site-packages/glanceclient/common/http.py(57)__init__()
and in /usr/lib/python2.7/site-packages/glanceclient/common/http.py(57)__init__()
self.identity_headers = kwargs.get('identity_headers') <<<<<<<<<<
self.auth_token = kwargs.get('token')
and the self.identity_headers may be like:
{'X-Service-Catalog': '[]', 'X-Auth-Token': None, 'X-Roles': u'admin', 'X-Tenant-Id': None, 'X-User-Id': None, 'X-Identity-Status': 'Confirmed'}
and for https://review.openstack.org/#/c/136326/,
for the code:
if self.identity_headers:
for k, v in six.iteritems(self.identity_headers): headers.setdefault(k, v)
headers would be like: {'X-Service-Catalog': '[]', 'X-Auth-Token': None, 'X-Roles': u'admin', 'X-Tenant-Id': None, 'X-User-Id': None, 'X-Identity-Status': 'Confirmed', ....}
so "headers = self.encode_headers(headers)" in /usr/lib/python2.7/site-packages/glanceclient/common/http.py(1957)__request()
would raise TypeError("NoneType can't be encoded"), thus resize(or other operation need call glance) would fail.
refer to https:/ /review. openstack. org/#/c/ 129289/
if you're using Nova but don't have Nova configured with 'keystone' (see nova.image. glance. _create_ glance_ client for details), python2. 7/site- packages/ glanceclient/ v1/client. py(36)_ _init__ () (endpoint, *args, **kwargs) python2. 7/site- packages/ glanceclient/ common/ http.py( 57)__init_ _()
auth_strategy=
and when you resize(or other operation need call glance) an VM, it may call
glanceclient, and code may go to the logic like:
/usr/lib/
-> self.http_client = http.HTTPClient
> /usr/lib/
and in /usr/lib/ python2. 7/site- packages/ glanceclient/ common/ http.py( 57)__init_ _() headers = kwargs. get('identity_ headers' ) <<<<<<<<<< headers may be like: Catalog' : '[]', 'X-Auth-Token': None, 'X-Roles': u'admin', 'X-Tenant-Id': None, 'X-User-Id': None, 'X-Identity- Status' : 'Confirmed'}
self.identity_
self.auth_token = kwargs.get('token')
and the self.identity_
{'X-Service-
and for https:/ /review. openstack. org/#/c/ 136326/, headers: self.identity_ headers) :
headers. setdefault( k, v)
for the code:
if self.identity_
for k, v in six.iteritems(
headers would be like: {'X-Service- Catalog' : '[]', 'X-Auth-Token': None, 'X-Roles': u'admin', 'X-Tenant-Id': None, 'X-User-Id': None, 'X-Identity- Status' : 'Confirmed', ....}
so "headers = self.encode_ headers( headers) " in /usr/lib/ python2. 7/site- packages/ glanceclient/ common/ http.py( 1957)__ request( )
would raise TypeError("NoneType can't be encoded"), thus resize(or other operation need call glance) would fail.