Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
opoplawski committed Mar 23, 2024
1 parent f6c1a66 commit a4ab045
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions plugins/module_utils/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ def _log_fields(self, before=None):
values += self.format_cli_field(self.obj, 'subnet', fname='ipv4_prefixlen')
values += self.format_cli_field(self.obj, 'gateway', fname='ipv4_gateway')
values += self.format_cli_field(self.params, 'ipv6_type', default='none')
values += self.format_cli_field(self.obj, 'ipaddrv6', fname='ipv6_address')
if self.obj['ipaddrv6'] != 'slaac':
values += self.format_cli_field(self.obj, 'ipaddrv6', fname='ipv6_address')
values += self.format_cli_field(self.obj, 'subnetv6', fname='ipv6_prefixlen')
values += self.format_cli_field(self.obj, 'gatewayv6', fname='ipv6_gateway')
values += self.format_cli_field(self.params, 'mac')
Expand All @@ -550,8 +551,15 @@ def _log_fields(self, before=None):
values += self.format_updated_cli_field(self.obj, before, 'ipaddr', add_comma=(values), fname='ipv4_address')
values += self.format_updated_cli_field(self.obj, before, 'subnet', add_comma=(values), fname='ipv4_prefixlen')
values += self.format_updated_cli_field(self.obj, before, 'gateway', add_comma=(values), fname='ipv4_gateway')
values += self.format_updated_cli_field(self.obj, before, 'ipv6_type', add_comma=(values), log_none='True')
values += self.format_updated_cli_field(self.obj, before, 'ipaddrv6', add_comma=(values), fname='ipv6_address')
if self.obj['ipaddrv6'] == 'slaac' and before['ipaddrv6'] != 'slaac':
res = "ipv6_type=slaac"
if values:
values += ", " + res
else:
values += res
else:
values += self.format_updated_cli_field(self.obj, before, 'ipv6_type', add_comma=(values), log_none='True')
values += self.format_updated_cli_field(self.obj, before, 'ipaddrv6', add_comma=(values), fname='ipv6_address')
values += self.format_updated_cli_field(self.obj, before, 'subnetv6', add_comma=(values), fname='ipv6_prefixlen')
values += self.format_updated_cli_field(self.obj, before, 'gatewayv6', add_comma=(values), fname='ipv6_gateway')
values += self.format_updated_cli_field(self.obj, before, 'spoofmac', add_comma=(values), fname='mac')
Expand Down

0 comments on commit a4ab045

Please sign in to comment.