diff options
author | Sumit Naiksatam <sumitnaiksatam@gmail.com> | 2013-09-27 17:39:27 -0700 |
---|---|---|
committer | Sumit Naiksatam <sumitnaiksatam@gmail.com> | 2013-09-30 00:14:14 -0700 |
commit | 1b911a4f1b0f9f860a4cc9edd466cf2268f6ce6b (patch) | |
tree | 39d81235fd69b102f319371e74745fc76a66e067 | |
parent | 15d5e508918ec7dda66c14838c1c0b7418a99d15 (diff) | |
download | python-neutronclient-1b911a4f1b0f9f860a4cc9edd466cf2268f6ce6b.tar.gz |
Fixes the display message for the insert/remove firewall rule CLI
Removing the json.dumps and adding a more relevant message.
Closes bug: 1232313
Change-Id: I19da455e76af1cb60e94c9a17880936c515f899d
-rw-r--r-- | neutronclient/neutron/v2_0/fw/firewallpolicy.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/neutronclient/neutron/v2_0/fw/firewallpolicy.py b/neutronclient/neutron/v2_0/fw/firewallpolicy.py index d3b3d25..f5b95ba 100644 --- a/neutronclient/neutron/v2_0/fw/firewallpolicy.py +++ b/neutronclient/neutron/v2_0/fw/firewallpolicy.py @@ -17,11 +17,11 @@ # # vim: tabstop=4 shiftwidth=4 softtabstop=4 -import json import logging import string from neutronclient.neutron import v2_0 as neutronv20 +from neutronclient.openstack.common.gettextutils import _ def _format_firewall_rules(firewall_policy): @@ -171,9 +171,10 @@ class FirewallPolicyInsertRule(neutronv20.UpdateCommand): _id = neutronv20.find_resourceid_by_name_or_id(neutron_client, self.resource, parsed_args.id) - policy_data = self.call_api(neutron_client, _id, body) - print json.dumps(policy_data) - return + self.call_api(neutron_client, _id, body) + print >>self.app.stdout, ( + _('Inserted firewall rule in firewall policy %(id)s') % + {'id': parsed_args.id}) class FirewallPolicyRemoveRule(neutronv20.UpdateCommand): @@ -212,6 +213,7 @@ class FirewallPolicyRemoveRule(neutronv20.UpdateCommand): _id = neutronv20.find_resourceid_by_name_or_id(neutron_client, self.resource, parsed_args.id) - policy_data = self.call_api(neutron_client, _id, body) - print json.dumps(policy_data) - return + self.call_api(neutron_client, _id, body) + print >>self.app.stdout, ( + _('Removed firewall rule from firewall policy %(id)s') % + {'id': parsed_args.id}) |