diff --git a/nova/api/metadata/handler.py b/nova/api/metadata/handler.py index 92ae37c017ed..ec0f31125b5b 100644 --- a/nova/api/metadata/handler.py +++ b/nova/api/metadata/handler.py @@ -206,8 +206,7 @@ class MetadataRequestHandler(wsgi.Application): if meta_data is None: LOG.error(_LE('Failed to get metadata for instance id: %s'), instance_id) - - if meta_data.instance['project_id'] != tenant_id: + elif meta_data.instance['project_id'] != tenant_id: LOG.warn(_LW("Tenant_id %(tenant_id)s does not match tenant_id " "of instance %(instance_id)s."), {'tenant_id': tenant_id, 'instance_id': instance_id})