text: begin_unit
  comment|'# Copyright 2010 United States Government as represented by the'
  nl|'\n'
  comment|'# Administrator of the National Aeronautics and Space Administration.'
  nl|'\n'
  comment|'# All Rights Reserved.'
  nl|'\n'
  comment|'#'
  nl|'\n'
  comment|'#    Licensed under the Apache License, Version 2.0 (the "License"); you may'
  nl|'\n'
  comment|'#    not use this file except in compliance with the License. You may obtain'
  nl|'\n'
  comment|'#    a copy of the License at'
  nl|'\n'
  comment|'#'
  nl|'\n'
  comment|'#         http://www.apache.org/licenses/LICENSE-2.0'
  nl|'\n'
  comment|'#'
  nl|'\n'
  comment|'#    Unless required by applicable law or agreed to in writing, software'
  nl|'\n'
  comment|'#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
  nl|'\n'
  comment|'#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
  nl|'\n'
  comment|'#    License for the specific language governing permissions and limitations'
  nl|'\n'
  comment|'#    under the License.'
  nl|'\n'
  nl|'\n'
  string|'"""\nWSGI middleware for OpenStack Compute API.\n"""'
  newline|'\n'
  nl|'\n'
  name|'from'
  name|'oslo_log'
  name|'import'
  name|'log'
  name|'as'
  name|'logging'
  newline|'\n'
  nl|'\n'
  name|'import'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  name|'import'
  name|'extension_info'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'consoles'
  name|'as'
  name|'v2_consoles'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'extensions'
  name|'as'
  name|'v2_extensions'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'flavors'
  name|'as'
  name|'v2_flavors'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'image_metadata'
  name|'as'
  name|'v2_image_metadata'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'images'
  name|'as'
  name|'v2_images'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'ips'
  name|'as'
  name|'v2_ips'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'limits'
  name|'as'
  name|'v2_limits'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'server_metadata'
  name|'as'
  name|'v2_server_metadata'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'servers'
  name|'as'
  name|'v2_servers'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'compute'
  op|'.'
  name|'legacy_v2'
  name|'import'
  name|'versions'
  name|'as'
  name|'legacy_v2_versions'
  newline|'\n'
  name|'import'
  name|'nova'
  op|'.'
  name|'conf'
  newline|'\n'
  name|'from'
  name|'nova'
  op|'.'
  name|'i18n'
  name|'import'
  name|'_LW'
  newline|'\n'
  nl|'\n'
  nl|'\n'
  DECL|variable|CONF
  name|'CONF'
  op|'='
  name|'nova'
  op|'.'
  name|'conf'
  op|'.'
  name|'CONF'
  newline|'\n'
  DECL|variable|LOG
  name|'LOG'
  op|'='
  name|'logging'
  op|'.'
  name|'getLogger'
  op|'('
  name|'__name__'
  op|')'
  newline|'\n'
  nl|'\n'
  nl|'\n'
  DECL|class|APIRouter
  name|'class'
  name|'APIRouter'
  op|'('
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'APIRouter'
  op|')'
  op|':'
  newline|'\n'
  indent|'    '
  string|'"""Routes requests on the OpenStack API to the appropriate controller\n    and method.\n    """'
  newline|'\n'
  DECL|variable|ExtensionManager
  name|'ExtensionManager'
  op|'='
  name|'v2_extensions'
  op|'.'
  name|'ExtensionManager'
  newline|'\n'
  nl|'\n'
  DECL|member|__init__
  name|'def'
  name|'__init__'
  op|'('
  name|'self'
  op|','
  name|'ext_mgr'
  op|'='
  name|'None'
  op|','
  name|'init_only'
  op|'='
  name|'None'
  op|')'
  op|':'
  newline|'\n'
  indent|'        '
  name|'LOG'
  op|'.'
  name|'warning'
  op|'('
  name|'_LW'
  op|'('
  nl|'\n'
  string|'"Deprecated: Starting with the Liberty release, the v2 API was "'
  nl|'\n'
  string|'"already deprecated and the v2.1 API is set as the default. Nova "'
  nl|'\n'
  string|'"also supports v2.1 API legacy v2 compatible mode for switching "'
  nl|'\n'
  string|'"to v2.1 API smoothly. For more information on how to configure "'
  nl|'\n'
  string|'"v2.1 API and legacy v2 compatible mode, please refer Nova "'
  nl|'\n'
  string|'"api-paste.ini sample file."'
  op|')'
  op|')'
  newline|'\n'
  name|'super'
  op|'('
  name|'APIRouter'
  op|','
  name|'self'
  op|')'
  op|'.'
  name|'__init__'
  op|'('
  name|'ext_mgr'
  op|'='
  name|'ext_mgr'
  op|','
  nl|'\n'
  name|'init_only'
  op|'='
  name|'init_only'
  op|')'
  newline|'\n'
  nl|'\n'
  DECL|member|_setup_routes
  dedent|''
  name|'def'
  name|'_setup_routes'
  op|'('
  name|'self'
  op|','
  name|'mapper'
  op|','
  name|'ext_mgr'
  op|','
  name|'init_only'
  op|')'
  op|':'
  newline|'\n'
  indent|'        '
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'versions'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'versions'"
  op|']'
  op|'='
  name|'legacy_v2_versions'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'mapper'
  op|'.'
  name|'connect'
  op|'('
  string|'"versions"'
  op|','
  string|'"/"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'versions'"
  op|']'
  op|','
  nl|'\n'
  name|'action'
  op|'='
  string|"'show'"
  op|','
  nl|'\n'
  name|'conditions'
  op|'='
  op|'{'
  string|'"method"'
  op|':'
  op|'['
  string|"'GET'"
  op|']'
  op|'}'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'mapper'
  op|'.'
  name|'redirect'
  op|'('
  string|'""'
  op|','
  string|'"/"'
  op|')'
  newline|'\n'
  nl|'\n'
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'consoles'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'consoles'"
  op|']'
  op|'='
  name|'v2_consoles'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"console"'
  op|','
  string|'"consoles"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'consoles'"
  op|']'
  op|','
  nl|'\n'
  name|'parent_resource'
  op|'='
  name|'dict'
  op|'('
  name|'member_name'
  op|'='
  string|"'server'"
  op|','
  nl|'\n'
  name|'collection_name'
  op|'='
  string|"'servers'"
  op|')'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'consoles'"
  name|'in'
  name|'init_only'
  name|'or'
  string|"'servers'"
  name|'in'
  name|'init_only'
  name|'or'
  string|"'ips'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'servers'"
  op|']'
  op|'='
  name|'v2_servers'
  op|'.'
  name|'create_resource'
  op|'('
  name|'ext_mgr'
  op|')'
  newline|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"server"'
  op|','
  string|'"servers"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'servers'"
  op|']'
  op|','
  nl|'\n'
  name|'collection'
  op|'='
  op|'{'
  string|"'detail'"
  op|':'
  string|"'GET'"
  op|'}'
  op|','
  nl|'\n'
  name|'member'
  op|'='
  op|'{'
  string|"'action'"
  op|':'
  string|"'POST'"
  op|'}'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'ips'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'ips'"
  op|']'
  op|'='
  name|'v2_ips'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"ip"'
  op|','
  string|'"ips"'
  op|','
  name|'controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'ips'"
  op|']'
  op|','
  nl|'\n'
  name|'parent_resource'
  op|'='
  name|'dict'
  op|'('
  name|'member_name'
  op|'='
  string|"'server'"
  op|','
  nl|'\n'
  name|'collection_name'
  op|'='
  string|"'servers'"
  op|')'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'images'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'images'"
  op|']'
  op|'='
  name|'v2_images'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"image"'
  op|','
  string|'"images"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'images'"
  op|']'
  op|','
  nl|'\n'
  name|'collection'
  op|'='
  op|'{'
  string|"'detail'"
  op|':'
  string|"'GET'"
  op|'}'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'limits'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'limits'"
  op|']'
  op|'='
  name|'v2_limits'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"limit"'
  op|','
  string|'"limits"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'limits'"
  op|']'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'flavors'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'flavors'"
  op|']'
  op|'='
  name|'v2_flavors'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"flavor"'
  op|','
  string|'"flavors"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'flavors'"
  op|']'
  op|','
  nl|'\n'
  name|'collection'
  op|'='
  op|'{'
  string|"'detail'"
  op|':'
  string|"'GET'"
  op|'}'
  op|','
  nl|'\n'
  name|'member'
  op|'='
  op|'{'
  string|"'action'"
  op|':'
  string|"'POST'"
  op|'}'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'image_metadata'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'v2immeta'
  op|'='
  name|'v2_image_metadata'
  newline|'\n'
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'image_metadata'"
  op|']'
  op|'='
  name|'v2immeta'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'image_metadata_controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'image_metadata'"
  op|']'
  newline|'\n'
  nl|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"image_meta"'
  op|','
  string|'"metadata"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'image_metadata_controller'
  op|','
  nl|'\n'
  name|'parent_resource'
  op|'='
  name|'dict'
  op|'('
  name|'member_name'
  op|'='
  string|"'image'"
  op|','
  nl|'\n'
  name|'collection_name'
  op|'='
  string|"'images'"
  op|')'
  op|')'
  newline|'\n'
  nl|'\n'
  name|'mapper'
  op|'.'
  name|'connect'
  op|'('
  string|'"metadata"'
  op|','
  nl|'\n'
  string|'"/{project_id}/images/{image_id}/metadata"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'image_metadata_controller'
  op|','
  nl|'\n'
  name|'action'
  op|'='
  string|"'update_all'"
  op|','
  nl|'\n'
  name|'conditions'
  op|'='
  op|'{'
  string|'"method"'
  op|':'
  op|'['
  string|"'PUT'"
  op|']'
  op|'}'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  name|'if'
  name|'init_only'
  name|'is'
  name|'None'
  name|'or'
  string|"'server_metadata'"
  name|'in'
  name|'init_only'
  op|':'
  newline|'\n'
  indent|'            '
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'server_metadata'"
  op|']'
  op|'='
  name|'v2_server_metadata'
  op|'.'
  name|'create_resource'
  op|'('
  op|')'
  newline|'\n'
  name|'server_metadata_controller'
  op|'='
  name|'self'
  op|'.'
  name|'resources'
  op|'['
  string|"'server_metadata'"
  op|']'
  newline|'\n'
  nl|'\n'
  name|'mapper'
  op|'.'
  name|'resource'
  op|'('
  string|'"server_meta"'
  op|','
  string|'"metadata"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'server_metadata_controller'
  op|','
  nl|'\n'
  name|'parent_resource'
  op|'='
  name|'dict'
  op|'('
  name|'member_name'
  op|'='
  string|"'server'"
  op|','
  nl|'\n'
  name|'collection_name'
  op|'='
  string|"'servers'"
  op|')'
  op|')'
  newline|'\n'
  nl|'\n'
  name|'mapper'
  op|'.'
  name|'connect'
  op|'('
  string|'"metadata"'
  op|','
  nl|'\n'
  string|'"/{project_id}/servers/{server_id}/metadata"'
  op|','
  nl|'\n'
  name|'controller'
  op|'='
  name|'server_metadata_controller'
  op|','
  nl|'\n'
  name|'action'
  op|'='
  string|"'update_all'"
  op|','
  nl|'\n'
  name|'conditions'
  op|'='
  op|'{'
  string|'"method"'
  op|':'
  op|'['
  string|"'PUT'"
  op|']'
  op|'}'
  op|')'
  newline|'\n'
  nl|'\n'
  nl|'\n'
  DECL|class|APIRouterV21
  dedent|''
  dedent|''
  dedent|''
  name|'class'
  name|'APIRouterV21'
  op|'('
  name|'nova'
  op|'.'
  name|'api'
  op|'.'
  name|'openstack'
  op|'.'
  name|'APIRouterV21'
  op|')'
  op|':'
  newline|'\n'
  indent|'    '
  string|'"""Routes requests on the OpenStack API to the appropriate controller\n    and method.\n    """'
  newline|'\n'
  DECL|member|__init__
  name|'def'
  name|'__init__'
  op|'('
  name|'self'
  op|','
  name|'init_only'
  op|'='
  name|'None'
  op|')'
  op|':'
  newline|'\n'
  indent|'        '
  name|'self'
  op|'.'
  name|'_loaded_extension_info'
  op|'='
  name|'extension_info'
  op|'.'
  name|'LoadedExtensionInfo'
  op|'('
  op|')'
  newline|'\n'
  name|'super'
  op|'('
  name|'APIRouterV21'
  op|','
  name|'self'
  op|')'
  op|'.'
  name|'__init__'
  op|'('
  name|'init_only'
  op|')'
  newline|'\n'
  nl|'\n'
  DECL|member|_register_extension
  dedent|''
  name|'def'
  name|'_register_extension'
  op|'('
  name|'self'
  op|','
  name|'ext'
  op|')'
  op|':'
  newline|'\n'
  indent|'        '
  name|'return'
  name|'self'
  op|'.'
  name|'loaded_extension_info'
  op|'.'
  name|'register_extension'
  op|'('
  name|'ext'
  op|'.'
  name|'obj'
  op|')'
  newline|'\n'
  nl|'\n'
  dedent|''
  op|'@'
  name|'property'
  newline|'\n'
  DECL|member|loaded_extension_info
  name|'def'
  name|'loaded_extension_info'
  op|'('
  name|'self'
  op|')'
  op|':'
  newline|'\n'
  indent|'        '
  name|'return'
  name|'self'
  op|'.'
  name|'_loaded_extension_info'
  newline|'\n'
  dedent|''
  dedent|''
  endmarker|''
  end_unit
  