Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Commit f5e423d

Browse files
committed
fix issues
Signed-off-by: Sumit Jaiswal <[email protected]>
1 parent 359d074 commit f5e423d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

module_utils/ios/facts/l3_interfaces/l3_interfaces.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from ansible.module_utils.ios.facts.base import FactsBase
1616
from ansible.module_utils.ios.utils.utils import get_interface_type, normalize_interface
17-
17+
import q
1818

1919
class L3_interfacesFacts(FactsBase):
2020
""" The ios l3 interfaces fact class
@@ -72,12 +72,12 @@ def render_config(self, spec, conf):
7272
elif 'dhcp' in each:
7373
config["ipv4"] = 'dhcp'
7474
if 'hostname' in each and 'client-id' in each:
75-
config['dhcp_client'] = each.split(' hostname ')[0].split('client-id ')[-1]
75+
config['dhcp_client'] = each.split(' hostname ')[0].split('/')[-1]
7676
config["dhcp_hostname"] = each.split(' hostname ')[-1]
77-
elif 'hostname' in each:
77+
if 'hostname' in each and not config["dhcp_hostname"]:
7878
config["dhcp_hostname"] = each.split(' hostname ')[-1]
79-
elif 'client-id' in each:
80-
config['dhcp_client'] = ipv4.split(' client-id ')[-1]
79+
if 'client-id' in each and not config['dhcp_client']:
80+
config['dhcp_client'] = each.split('/')[-1]
8181
else:
8282
config["ipv4"] = each
8383

0 commit comments

Comments
 (0)