Bug 890539 - glance-cache-manage throws a warning: "UserWarning: The 'glance.client' module is deprecated in favor of the 'glanceclient' module"
Summary: glance-cache-manage throws a warning: "UserWarning: The 'glance.client' modul...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 2.0 (Folsom)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: snapshot4
: 2.1
Assignee: Eoghan Glynn
QA Contact: Yaniv Kaul
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-27 15:52 UTC by Yaniv Kaul
Modified: 2016-04-26 13:22 UTC (History)
3 users (show)

Fixed In Version: openstack-glance-2012.2.3-2.el6ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-21 19:04:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0672 0 normal SHIPPED_LIVE Red Hat OpenStack 2.0 (Folsom) Preview bug fix and enhancement update 2013-03-21 23:02:46 UTC

Description Yaniv Kaul 2012-12-27 15:52:29 UTC
Description of problem:
[root@ykaul-os-horizon ~(keystone_admin)]$ glance-cache-manage  list-cached
/usr/bin/glance-cache-manage:40: UserWarning: The 'glance.client' module is deprecated in favor of the 'glanceclient' module provided by python-glanceclient (see http://github.com/openstack/python-glanceclient).
  from glance import client as glance_client
Found 1 cached images...
ID                                   Last Accessed (UTC) Last Modified (UTC) Size           Hits      
------------------------------------ ------------------- ------------------- -------------- ----------
a92439a6-5923-4ca8-98ae-ceabe3c164f6 0.0                 1356610380.5             101920768          0
[root@ykaul-os-horizon ~(keystone_admin)]$ rpm -qf `which glance-cache-manage`
openstack-glance-2012.2.1-1.el6ost.noarch


Version-Release number of selected component (if applicable):
openstack-glance-2012.2.1-1.el6ost.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Perry Myers 2013-01-03 16:40:26 UTC
Solution here is to simply remove this binary from the spec file so that it is not installed by the RPM

Comment 3 Eoghan Glynn 2013-01-03 16:43:57 UTC
Blacklist obsolete glance/client in the spec file to ensure these lingering dependencies fail fast.

Comment 4 Yaniv Kaul 2013-01-03 16:45:27 UTC
(In reply to comment #2)
> Solution here is to simply remove this binary from the spec file so that it
> is not installed by the RPM

Which binary? We need glance-cache-manage, AFAIK. What replaces it?

Comment 5 Eoghan Glynn 2013-02-18 10:44:05 UTC
Thinking about this some more ... I'm not convinced that simply removing the glance-cache-manage binary from the spec file is the way to go here, as it'll remove some useful utilities providing users with control of the glance cache, e.g.:

- marking certain images as being eligible for pre-fetching

- listing the currently cached images on a particular host

- initiating eviction of cached images

Now of course all these operation are exposed via a RESTful API by the cachemanagement middleware, so could be invoked directly via curl or some such. However, the convenience provided by a special-purpose utility is worth preserving IMO.

So I would propose instead either:

(a) extend python-glanceclient to support the interaction with the cache management resource.

or:

(b) modify glance.image_cache.client so that it extends the base client logic from python-glanceclient instead of the legacy glance.common.client.BaseClient.

Option (b) would be simpler from a packaging point of view, but option (a) may be the more correct option long term.

In any case, I'll consult with the glance PTL upstream before finalizing a strategy here.

Comment 6 Eoghan Glynn 2013-02-19 13:57:45 UTC
After more investigation, I see that the deprecation warning has been effectively by-passed on the grizzly master with:

  https://github.com/openstack/glance/commit/05f1e1a8

(i.e. the addition of a new thin image_cache client that extends a less derived base class in the legacy client library, and thus avoids the deprecation warning *without* rebasing on python-glanceclient).

We could either backport the above mentioned patch to stable/folsom, or even simpler, just swallow the deprecation warning with a warnings filter when used "internally" from the glance-cache-manage utility.

I prefer the latter approach as it's less intrusive on stable. 

Essentially the warning on import of the legacy glance client is only useful as a signal to "external" usages of this deprecated library.

For internal usage such as the glance-cache-manage utility, it just exposes internal technical debt as an apparent user-facing warning, and thus has no real value.

Comment 7 Eoghan Glynn 2013-02-19 16:38:05 UTC
Fix proposed to stable/folsom upstream:

  https://review.openstack.org/22305

(the CI failure is due to an transient issue with pypi).

Comment 9 Eoghan Glynn 2013-02-25 11:27:59 UTC
Patch landed internally.

Comment 10 Eoghan Glynn 2013-02-27 09:33:57 UTC
How to test
-----------

Simply run:

  $ glance-cache-manage list-cached

and note the lack of a deprecation warning on the glance.client module.

Comment 14 errata-xmlrpc 2013-03-21 19:04:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0672.html


Note You need to log in before you can comment on or make changes to this bug.