def create_or_remove_acl_table(duthost, acl_table_config, setup, op):
    for sonic_host_or_asic_inst in duthost.get_sonic_host_and_frontend_asic_instance():
        namespace = (sonic_host_or_asic_inst.namespace if hasattr(sonic_host_or_asic_inst, 'namespace') else '')
        if (op == 'add'):
            logger.info('Creating ACL table: "{}" in namespace {} on device {}'.format(acl_table_config['table_name'], namespace, duthost))
            sonic_host_or_asic_inst.command('config acl add table {} {} -s {} -p {}'.format(acl_table_config['table_name'], acl_table_config['table_type'], acl_table_config['table_stage'], ','.join(setup['acl_table_ports'][namespace])))
        else:
            logger.info('Removing ACL table "{}" in namespace {} on device {}'.format(acl_table_config['table_name'], namespace, duthost))
            sonic_host_or_asic_inst.command('config acl remove table {}'.format(acl_table_config['table_name']))
def create_or_remove_acl_table(duthost, acl_table_config, setup, op):
    for sonic_host_or_asic_inst in duthost.get_sonic_host_and_frontend_asic_instance():
        namespace = (sonic_host_or_asic_inst.namespace if hasattr(sonic_host_or_asic_inst, 'namespace') else )
        if (op == 'add'):
            logger.info('Creating ACL table: "{}" in namespace {} on device {}'.format(acl_table_config['table_name'], namespace, duthost))
            sonic_host_or_asic_inst.command('config acl add table {} {} -s {} -p {}'.format(acl_table_config['table_name'], acl_table_config['table_type'], acl_table_config['table_stage'], ','.join(setup['acl_table_ports'][namespace])))
        else:
            logger.info('Removing ACL table "{}" in namespace {} on device {}'.format(acl_table_config['table_name'], namespace, duthost))
            sonic_host_or_asic_inst.command('config acl remove table {}'.format(acl_table_config['table_name']))