@@ -303,12 +303,12 @@ def get_front_end_namespaces():
303
303
"""
304
304
Get the namespaces in the platform. For multi-asic devices we get the namespaces
305
305
mapped to asic which have front-panel interfaces. For single ASIC device it is the
306
- EMPTY_NAMESPACE which maps to the linux host.
306
+ DEFAULT_NAMESPACE which maps to the linux host.
307
307
308
308
Returns:
309
309
a list of namespaces
310
310
"""
311
- namespaces = [EMPTY_NAMESPACE ]
311
+ namespaces = [DEFAULT_NAMESPACE ]
312
312
if is_multi_asic ():
313
313
ns_list = get_all_namespaces ()
314
314
namespaces = ns_list ['front_ns' ]
@@ -318,13 +318,16 @@ def get_front_end_namespaces():
318
318
def get_asic_index_from_namespace (namespace ):
319
319
"""
320
320
Get asic index from the namespace name.
321
- With single ASIC platform, namespace is EMPTY_NAMESPACE, return asic_index 0
321
+ With single ASIC platform, return asic_index 0, which is mapped to the only asic present.
322
322
323
323
Returns:
324
324
asic_index as an integer.
325
+ None, if namespace given as input is not mapped to any asic in multi-asic platform.
325
326
"""
326
- asic_id_string = get_asic_id_from_name (namespace )
327
- if asic_id_string is not None :
328
- return int (asic_id_string )
327
+ if is_multi_asic ():
328
+ asic_id_string = get_asic_id_from_name (namespace )
329
+ if asic_id_string is not None :
330
+ return int (asic_id_string )
331
+ return None
329
332
330
333
return 0
0 commit comments