#NEWLINE# def check_table( table = None , family = 'ipv4' ) : #NEWLINE# #INDENT# "\n    Check for the existence of a table\n\n    CLI Example::\n\n        salt '*' nftables.check_table nat\n    " #NEWLINE# if ( not table ) : #NEWLINE# #INDENT# return 'Error: table needs to be specified' #NEWLINE# #UNINDENT# nft_family = _NFTABLES_FAMILIES [ family ] #NEWLINE# cmd = '{0} list tables {1}' . format ( _nftables_cmd ( ) , nft_family ) #NEWLINE# out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) . find ( 'table {0} {1}' . format ( nft_family , table ) ) #NEWLINE# if ( out != ( - 1 ) ) : #NEWLINE# #INDENT# out = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( not out ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# return out