From 8e2bc9cb9c70f3d287bf25fb8d1a2b098c6ed3e5 Mon Sep 17 00:00:00 2001 From: Reedip Date: Tue, 21 Mar 2017 02:39:52 +0000 Subject: [PATCH] Fix Trivial Changes in [1] [1] had some trivial changes in the main code, which are being put forward in this patch, to consider future scenarios. [1]: I77a933f4b3ce875c63cef5b6a32aee78fd844b03 TrivialFix Change-Id: I8e8fbb194cd319e5605f09c94ae09e952d0961b1 --- doc/source/command-objects/network-agent.rst | 12 ++++++------ openstackclient/network/v2/network_agent.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/source/command-objects/network-agent.rst b/doc/source/command-objects/network-agent.rst index d764f3de1c..f69d0ece69 100644 --- a/doc/source/command-objects/network-agent.rst +++ b/doc/source/command-objects/network-agent.rst @@ -25,15 +25,15 @@ Add network to an agent .. describe:: --dhcp - Add a network to DHCP agent. + Add a network to DHCP agent .. describe:: - Agent to which a network is added. (ID only) + Agent to which a network is added (ID only) .. describe:: - Network to be added to an agent. (ID or name) + Network to be added to an agent (ID or name) network agent delete -------------------- @@ -77,7 +77,7 @@ List network agents .. option:: --network - List agents hosting a network. (ID or name) + List agents hosting a network (ID or name) network agent set ----------------- @@ -144,8 +144,8 @@ Remove network from an agent .. describe:: - Agent to which a network is removed. (ID only) + Agent to which a network is removed (ID only) .. describe:: - Network to be removed from an agent. (ID or name) + Network to be removed from an agent (ID or name) diff --git a/openstackclient/network/v2/network_agent.py b/openstackclient/network/v2/network_agent.py index 7c2edb88e2..dd3fdc2433 100644 --- a/openstackclient/network/v2/network_agent.py +++ b/openstackclient/network/v2/network_agent.py @@ -56,20 +56,20 @@ class AddNetworkToAgent(command.Command): parser.add_argument( 'agent_id', metavar='', - help=_('Agent to which a network is added. (ID only)')) + help=_('Agent to which a network is added (ID only)')) parser.add_argument( 'network', metavar='', - help=_('Network to be added to an agent. (ID or name)')) + help=_('Network to be added to an agent (ID or name)')) return parser def take_action(self, parsed_args): client = self.app.client_manager.network agent = client.get_agent(parsed_args.agent_id) + network = client.find_network( + parsed_args.network, ignore_missing=False) if parsed_args.dhcp: - network = client.find_network( - parsed_args.network, ignore_missing=False) try: client.add_dhcp_agent_to_network(agent, network) except Exception: @@ -225,19 +225,19 @@ class RemoveNetworkFromAgent(command.Command): parser.add_argument( 'agent_id', metavar='', - help=_('Agent to which a network is removed. (ID only)')) + help=_('Agent to which a network is removed (ID only)')) parser.add_argument( 'network', metavar='', - help=_('Network to be removed from an agent. (ID or name)')) + help=_('Network to be removed from an agent (ID or name)')) return parser def take_action(self, parsed_args): client = self.app.client_manager.network agent = client.get_agent(parsed_args.agent_id) + network = client.find_network( + parsed_args.network, ignore_missing=False) if parsed_args.dhcp: - network = client.find_network( - parsed_args.network, ignore_missing=False) try: client.remove_dhcp_agent_from_network(agent, network) except Exception: