diff options
| author | Eldar Nugaev <enugaev@griddynamics.com> | 2011-04-18 17:06:18 +0400 |
|---|---|---|
| committer | Eldar Nugaev <enugaev@griddynamics.com> | 2011-04-18 17:06:18 +0400 |
| commit | c49c372ec3e94331eb8a16a0af7c9c9c5e46bba0 (patch) | |
| tree | e1dbc907b226b4456f64d2ea47c217a551964f3d | |
| parent | 03840792687b915d9ffdced12f415b3d093b40b2 (diff) | |
Fix logging in openstack api
| -rw-r--r-- | nova/api/openstack/common.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py index 234f921ab..2ace9b3de 100644 --- a/nova/api/openstack/common.py +++ b/nova/api/openstack/common.py @@ -25,7 +25,7 @@ from nova import log as logging from nova import wsgi -LOG = logging.getLogger('common') +LOG = logging.getLogger('nova.api.openstack.common') FLAGS = flags.FLAGS @@ -116,8 +116,14 @@ def get_image_id_from_image_hash(image_service, context, image_hash): items = image_service.index(context) for image in items: image_id = image['id'] - if abs(hash(image_id)) == int(image_hash): - return image_id + try: + if abs(hash(image_id)) == int(image_hash): + return image_id + except ValueError: + msg = _("Requested image_id has wrong format: %s," + "should have numerical format" % image_id) + LOG.error(msg) + raise msg raise exception.NotFound(image_hash) |
