@@ -220,18 +220,18 @@ def submit_node_metadata(self, node_attrs, tags):
220
220
vendor = 'cisco_aci'
221
221
namespace = 'default'
222
222
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 ) ]
224
224
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 ) ,
232
232
]
233
233
device = DeviceMetadata (
234
- device_id = f' { namespace } :{ node .attributes .address } ' ,
234
+ device_id = '{ }:{}' . format ( namespace , node .attributes .address ) ,
235
235
id_tags = id_tags ,
236
236
tags = device_tags + tags ,
237
237
name = node .attributes .dn ,
@@ -248,12 +248,12 @@ def submit_interface_metadata(self, eth_attr, address, tags):
248
248
eth = Eth (attributes = eth_attr )
249
249
namespace = 'default'
250
250
interface = InterfaceMetadata (
251
- device_id = f' { namespace } :{ address } ' ,
251
+ device_id = '{ }:{}' . format ( namespace , address ) ,
252
252
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 ,
258
258
)
259
259
self .ndm_metadata (json .dumps (interface .model_dump ()))
0 commit comments