Merge "SDK refactor: Set "is_admin_state_up" for network agent"
This commit is contained in:
commit
95736cebc3
@ -282,11 +282,11 @@ class SetNetworkAgent(command.Command):
|
||||
attrs = {}
|
||||
if parsed_args.description is not None:
|
||||
attrs['description'] = str(parsed_args.description)
|
||||
# TODO(huanxuan): Also update by the new attribute name
|
||||
# "is_admin_state_up" after sdk 0.9.12
|
||||
if parsed_args.enable:
|
||||
attrs['is_admin_state_up'] = True
|
||||
attrs['admin_state_up'] = True
|
||||
if parsed_args.disable:
|
||||
attrs['is_admin_state_up'] = False
|
||||
attrs['admin_state_up'] = False
|
||||
client.update_agent(obj, **attrs)
|
||||
|
||||
|
@ -322,8 +322,6 @@ class TestRemoveNetworkFromAgent(TestNetworkAgent):
|
||||
self.agent, self.net)
|
||||
|
||||
|
||||
# TODO(huanxuan): Also update by the new attribute name
|
||||
# "is_admin_state_up" after sdk 0.9.12
|
||||
class TestSetNetworkAgent(TestNetworkAgent):
|
||||
|
||||
_network_agent = (
|
||||
@ -372,6 +370,7 @@ class TestSetNetworkAgent(TestNetworkAgent):
|
||||
attrs = {
|
||||
'description': 'new_description',
|
||||
'admin_state_up': True,
|
||||
'is_admin_state_up': True,
|
||||
}
|
||||
self.network.update_agent.assert_called_once_with(
|
||||
self._network_agent, **attrs)
|
||||
@ -393,6 +392,7 @@ class TestSetNetworkAgent(TestNetworkAgent):
|
||||
|
||||
attrs = {
|
||||
'admin_state_up': False,
|
||||
'is_admin_state_up': False,
|
||||
}
|
||||
self.network.update_agent.assert_called_once_with(
|
||||
self._network_agent, **attrs)
|
||||
|
Loading…
Reference in New Issue
Block a user