Skip to content

Commit 2fdd4ff

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix Trivial Changes in [1]"
2 parents 6329c04 + 8e2bc9c commit 2fdd4ff

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

doc/source/command-objects/network-agent.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Add network to an agent
2525
2626
.. describe:: --dhcp
2727

28-
Add a network to DHCP agent.
28+
Add a network to DHCP agent
2929

3030
.. describe:: <agent-id>
3131

32-
Agent to which a network is added. (ID only)
32+
Agent to which a network is added (ID only)
3333

3434
.. describe:: <network>
3535

36-
Network to be added to an agent. (ID or name)
36+
Network to be added to an agent (ID or name)
3737

3838
network agent delete
3939
--------------------
@@ -77,7 +77,7 @@ List network agents
7777

7878
.. option:: --network <network>
7979

80-
List agents hosting a network. (ID or name)
80+
List agents hosting a network (ID or name)
8181

8282
network agent set
8383
-----------------
@@ -144,8 +144,8 @@ Remove network from an agent
144144

145145
.. describe:: <agent-id>
146146

147-
Agent to which a network is removed. (ID only)
147+
Agent to which a network is removed (ID only)
148148

149149
.. describe:: <network>
150150

151-
Network to be removed from an agent. (ID or name)
151+
Network to be removed from an agent (ID or name)

openstackclient/network/v2/network_agent.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ def get_parser(self, prog_name):
5656
parser.add_argument(
5757
'agent_id',
5858
metavar='<agent-id>',
59-
help=_('Agent to which a network is added. (ID only)'))
59+
help=_('Agent to which a network is added (ID only)'))
6060
parser.add_argument(
6161
'network',
6262
metavar='<network>',
63-
help=_('Network to be added to an agent. (ID or name)'))
63+
help=_('Network to be added to an agent (ID or name)'))
6464

6565
return parser
6666

6767
def take_action(self, parsed_args):
6868
client = self.app.client_manager.network
6969
agent = client.get_agent(parsed_args.agent_id)
70+
network = client.find_network(
71+
parsed_args.network, ignore_missing=False)
7072
if parsed_args.dhcp:
71-
network = client.find_network(
72-
parsed_args.network, ignore_missing=False)
7373
try:
7474
client.add_dhcp_agent_to_network(agent, network)
7575
except Exception:
@@ -225,19 +225,19 @@ def get_parser(self, prog_name):
225225
parser.add_argument(
226226
'agent_id',
227227
metavar='<agent-id>',
228-
help=_('Agent to which a network is removed. (ID only)'))
228+
help=_('Agent to which a network is removed (ID only)'))
229229
parser.add_argument(
230230
'network',
231231
metavar='<network>',
232-
help=_('Network to be removed from an agent. (ID or name)'))
232+
help=_('Network to be removed from an agent (ID or name)'))
233233
return parser
234234

235235
def take_action(self, parsed_args):
236236
client = self.app.client_manager.network
237237
agent = client.get_agent(parsed_args.agent_id)
238+
network = client.find_network(
239+
parsed_args.network, ignore_missing=False)
238240
if parsed_args.dhcp:
239-
network = client.find_network(
240-
parsed_args.network, ignore_missing=False)
241241
try:
242242
client.remove_dhcp_agent_from_network(agent, network)
243243
except Exception:

0 commit comments

Comments
 (0)