From c4a899e681af63c45dc6d64bb8aad0bf2c599b4e Mon Sep 17 00:00:00 2001 From: wangshengjun Date: Fri, 16 Oct 2020 11:58:52 +0800 Subject: [PATCH] [crm/show]fix the 'crm show' error for acl table which bind point type is not PORT. Signed-off-by: wangshengjun --- crm/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crm/main.py b/crm/main.py index 33fbfb5de5..b8bf004484 100644 --- a/crm/main.py +++ b/crm/main.py @@ -102,11 +102,12 @@ def show_acl_resources(self): if crm_stats: for res in ["acl_group", "acl_table"]: - data.append([ - stage, bind_point, res, - crm_stats['crm_stats_' + res + "_used"], - crm_stats['crm_stats_' + res + "_available"] - ]) + if "crm_stats_" + res + "_used" in crm_stats: + data.append([ + stage, bind_point, res, + crm_stats['crm_stats_' + res + "_used"], + crm_stats['crm_stats_' + res + "_available"] + ]) click.echo() click.echo(tabulate(data, headers=header, tablefmt="simple", missingval=""))