diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-06-20 17:26:57 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-06-20 17:26:57 +0000 |
| commit | f5ae23ab86c662e2f75952e6aa62c02ab3855b9b (patch) | |
| tree | 5bee5786f26c329c7dee8847cebc9d11ece1a04f /openstackclient/compute/v2/agent.py | |
| parent | a99b54ef758477376a6254face4ff7fcc698dd8f (diff) | |
| parent | 047cb6849354f4fdf8d365bd109a0ed56a77d200 (diff) | |
| download | python-openstackclient-f5ae23ab86c662e2f75952e6aa62c02ab3855b9b.tar.gz | |
Merge "Standardize logger usage"
Diffstat (limited to 'openstackclient/compute/v2/agent.py')
| -rw-r--r-- | openstackclient/compute/v2/agent.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/openstackclient/compute/v2/agent.py b/openstackclient/compute/v2/agent.py index ce6898c1..62be2424 100644 --- a/openstackclient/compute/v2/agent.py +++ b/openstackclient/compute/v2/agent.py @@ -15,6 +15,8 @@ """Agent action implementations""" +import logging + from osc_lib.command import command from osc_lib import exceptions from osc_lib import utils @@ -23,6 +25,9 @@ import six from openstackclient.i18n import _ +LOG = logging.getLogger(__name__) + + class CreateAgent(command.ShowOne): """Create compute agent command""" @@ -96,14 +101,13 @@ class DeleteAgent(command.Command): compute_client.agents.delete(id) except Exception as e: result += 1 - self.app.log.error(_("Failed to delete agent with " - "ID '%(id)s': %(e)s") - % {'id': id, 'e': e}) + LOG.error(_("Failed to delete agent with ID '%(id)s': %(e)s"), + {'id': id, 'e': e}) if result > 0: total = len(parsed_args.id) msg = (_("%(result)s of %(total)s agents failed " - "to delete.") % {'result': result, 'total': total}) + "to delete.") % {'result': result, 'total': total}) raise exceptions.CommandError(msg) |
