Skip to content

Commit 163d168

Browse files
committed
Fix for py2.7 support
1 parent aaaf282 commit 163d168

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

cisco_aci/datadog_checks/cisco_aci/fabric.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,18 @@ def submit_node_metadata(self, node_attrs, tags):
220220
vendor = 'cisco_aci'
221221
namespace = 'default'
222222
node = Node(attributes=node_attrs)
223-
id_tags = [f'namespace:{namespace}', f'system_ip:{node.attributes.address}']
223+
id_tags = ['namespace:{}'.format(namespace), 'system_ip:{}'.format(node.attributes.address)]
224224
device_tags = [
225-
f'device_vendor:{vendor}',
226-
f'device_namespace:{namespace}',
227-
f'device_hostname:{node.attributes.dn}',
228-
f'hostname:{node.attributes.dn}',
229-
f'system_ip:{node.attributes.address}',
230-
f'device_ip:{node.attributes.address}',
231-
f'device_id:{namespace}:{node.attributes.address}',
225+
'device_vendor:{}'.format(vendor),
226+
'device_namespace:{}'.format(namespace),
227+
'device_hostname:{}'.format(node.attributes.dn),
228+
'hostname:{}'.format(node.attributes.dn),
229+
'system_ip:{}'.format(node.attributes.address),
230+
'device_ip:{}'.format(node.attributes.address),
231+
'device_id:{}:{}'.format(namespace, node.attributes.address),
232232
]
233233
device = DeviceMetadata(
234-
device_id=f'{namespace}:{node.attributes.address}',
234+
device_id='{}:{}'.format(namespace, node.attributes.address),
235235
id_tags=id_tags,
236236
tags=device_tags + tags,
237237
name=node.attributes.dn,
@@ -248,12 +248,12 @@ def submit_interface_metadata(self, eth_attr, address, tags):
248248
eth = Eth(attributes=eth_attr)
249249
namespace = 'default'
250250
interface = InterfaceMetadata(
251-
device_id=f'{namespace}:{address}',
251+
device_id='{}:{}'.format(namespace, address),
252252
id_tags=tags,
253-
index=f'{eth.attributes.id}',
254-
name=f'{eth.attributes.name}',
255-
description=f'{eth.attributes.desc}',
256-
mac_address=f'{eth.attributes.router_mac}',
257-
admin_status=f'{eth.attributes.admin_st}',
253+
index=eth.attributes.id,
254+
name=eth.attributes.name,
255+
description=eth.attributes.desc,
256+
mac_address=eth.attributes.router_mac,
257+
admin_status=eth.attributes.admin_st,
258258
)
259259
self.ndm_metadata(json.dumps(interface.model_dump()))

0 commit comments

Comments
 (0)