← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1517820] Re: glance api in openstack-dashboard can't support v2 glance service

 

Closing the bug as Invalid to avoid duplicate patches and waste of
efforts.

Sharat, please look at https://review.openstack.org/#/c/320039/
(implementation of the blueprint referenced above) - your feedback and
suggestions would be very welcome there.

** Changed in: horizon
       Status: In Progress => Invalid

** Changed in: horizon
     Assignee: Sharat Sharma (sharat-sharma) => (unassigned)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1517820

Title:
  glance api in openstack-dashboard can't support v2 glance service

Status in OpenStack Dashboard (Horizon):
  Invalid

Bug description:
  Reproduce procedure:
  1. glance service is configured to only support v2:
  # Allow access to version 1 of glance api
  #enable_v1_api=True
  enable_v1_api=False

  # Allow access to version 2 of glance api
  #enable_v2_api=True

  2. Configure openstack-dashboard to use v2 API for image service:
  OPENSTACK_API_VERSIONS = {
      "image": 2
  }

  3. Access the image page, and got error "Error: Unable to retrieve images.":
      http://xxx/dashboard/project/images/

  4. dashboards still uses v1 client to communicate with glance service:
  httpd log:
  [Thu Nov 19 17:38:12.372453 2015] [:error] [pid 30350] Recoverable error: HTTPMultipleChoices (HTTP 300) Requested version of OpenStack Images API is not available.

  glance log:
  2015-11-19 17:46:36.173 29679 WARNING glance.api.middleware.version_negotiation [-] Unknown version. Returning version choices.

  5. From openstack-dashboard code, although function glanceclient accepts parameter "version", but function image_list_detailed doesn't provide it:
  @memoized
  def glanceclient(request, version='1'):   <<<< Can accept the "version" parameter.
      url = base.url_for(request, 'image')
      insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
      cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
      return glance_client.Client(version, url, token=request.user.token.id,
                                  insecure=insecure, cacert=cacert)

  def image_list_detailed(request, marker=None, sort_dir='desc',
                          sort_key='created_at', filters=None, paginate=False):
      images_iter = glanceclient(request).images.list(page_size=request_size,     <<<<<< Doesn't use the specified version. 
                                                      limit=limit,
                                                      **kwargs)

  Some other functions have the similar problem, such as image_get,
  image_delete, and etc.

  Please advice,
  Thanks,
  Tony

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1517820/+subscriptions


References