Skip to content

Commit 95736ce

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "SDK refactor: Set "is_admin_state_up" for network agent"
2 parents bf1f47c + f8e8ace commit 95736ce

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

openstackclient/network/v2/network_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ def take_action(self, parsed_args):
282282
attrs = {}
283283
if parsed_args.description is not None:
284284
attrs['description'] = str(parsed_args.description)
285-
# TODO(huanxuan): Also update by the new attribute name
286-
# "is_admin_state_up" after sdk 0.9.12
287285
if parsed_args.enable:
286+
attrs['is_admin_state_up'] = True
288287
attrs['admin_state_up'] = True
289288
if parsed_args.disable:
289+
attrs['is_admin_state_up'] = False
290290
attrs['admin_state_up'] = False
291291
client.update_agent(obj, **attrs)
292292

openstackclient/tests/unit/network/v2/test_network_agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,6 @@ def test_network_from_dhcp_agent(self):
322322
self.agent, self.net)
323323

324324

325-
# TODO(huanxuan): Also update by the new attribute name
326-
# "is_admin_state_up" after sdk 0.9.12
327325
class TestSetNetworkAgent(TestNetworkAgent):
328326

329327
_network_agent = (
@@ -372,6 +370,7 @@ def test_set_all(self):
372370
attrs = {
373371
'description': 'new_description',
374372
'admin_state_up': True,
373+
'is_admin_state_up': True,
375374
}
376375
self.network.update_agent.assert_called_once_with(
377376
self._network_agent, **attrs)
@@ -393,6 +392,7 @@ def test_set_with_disable(self):
393392

394393
attrs = {
395394
'admin_state_up': False,
395+
'is_admin_state_up': False,
396396
}
397397
self.network.update_agent.assert_called_once_with(
398398
self._network_agent, **attrs)

0 commit comments

Comments
 (0)