Skip to content

Commit

Permalink
Swallow UserWarning from glance-cache-manage
Browse files Browse the repository at this point in the history
Fixes bug 1129445

Previously, we exposed internal technical debt as an apparent
user-facing warning.

Now the warning is swallowed in the internal case, but continues
to be seen by external users of this library.

Note that this fix is not relevant on master, as that the warning
no longer occurs in that case.

Change-Id: I30a835e0024acac8841b4746968abe7cae9e14cb
  • Loading branch information
Eoghan Glynn committed Feb 19, 2013
1 parent 98d9928 commit 12d28c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/glance-cache-manage
Expand Up @@ -26,6 +26,7 @@ import optparse
import os
import sys
import time
import warnings

# If ../glance/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
Expand All @@ -37,7 +38,10 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):

gettext.install('glance', unicode=1)

from glance import client as glance_client
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from glance import client as glance_client

from glance.common import exception
from glance.common import utils
from glance.version import version_info as version
Expand Down

0 comments on commit 12d28c3

Please sign in to comment.