def check_table(table=None, family='ipv4'):
 if (not table):
  return 'Error: table needs to be specified'
 nft_family = _NFTABLES_FAMILIES[family]
 cmd = '{0} list tables {1}'.format(_nftables_cmd(), nft_family)
 out = __salt__['cmd.run'](cmd, python_shell=False).find('table {0} {1}'.format(nft_family, table))
 if (out != (-1)):
  out = ''
 else:
  return False
 if (not out):
  return True
 return out

def check_table ( table = None , family = 'ipv4' ) : if ( not table ) : return 'Error: table needs to be specified' nft_family = _NFTABLES_FAMILIES [ family ] cmd = '{0} list tables {1}' . format ( _nftables_cmd ( ) , nft_family ) out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) . find ( 'table {0} {1}' . format ( nft_family , table ) ) if ( out != ( - 1 ) ) : out = '' else : return False if ( not out ) : return True return out
check for the existence of a table cli example:: salt * nftables .