Skip to content
Snippets Groups Projects
Commit 6f91d90b authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component - OpenConfigDriver:

- updated to new protobuf definitions for config rules
parent dacebe90
No related branches found
No related tags found
2 merge requests!54Release 2.0.0,!4Compute component:
...@@ -88,8 +88,9 @@ def test_device_openconfig_add_correct( ...@@ -88,8 +88,9 @@ def test_device_openconfig_add_correct(
device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID))
config_rules = [ config_rules = [
(ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value)
for config_rule in device_data.device_config.config_rules for config_rule in device_data.device_config.config_rules
if config_rule.WhichOneof('config_rule') == 'custom'
] ]
LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format(
'\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules])))
...@@ -135,8 +136,9 @@ def test_device_openconfig_configure( ...@@ -135,8 +136,9 @@ def test_device_openconfig_configure(
device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID))
config_rules = [ config_rules = [
(ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value)
for config_rule in device_data.device_config.config_rules for config_rule in device_data.device_config.config_rules
if config_rule.WhichOneof('config_rule') == 'custom'
] ]
LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format(
'\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules])))
...@@ -276,7 +278,7 @@ def test_device_openconfig_deconfigure( ...@@ -276,7 +278,7 @@ def test_device_openconfig_deconfigure(
device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID))
config_rules = [ config_rules = [
(ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value)
for config_rule in device_data.device_config.config_rules for config_rule in device_data.device_config.config_rules
if config_rule.WhichOneof('config_rule') == 'custom' if config_rule.WhichOneof('config_rule') == 'custom'
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment