#NEWLINE# def check_chain( table = 'filter' , chain = None , family = 'ipv4' ) : #NEWLINE# #INDENT# "\n    .. versionadded:: 2014.1.0\n\n    Check for the existence of a chain in the table\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' iptables.check_chain filter INPUT\n\n        IPv6:\n        salt '*' iptables.check_chain filter INPUT family=ipv6\n    " #NEWLINE# if ( not chain ) : #NEWLINE# #INDENT# return 'Error: Chain needs to be specified' #NEWLINE# #UNINDENT# cmd = '{0}-save -t {1}' . format ( _iptables_cmd ( family ) , table ) #NEWLINE# out = __salt__ [ 'cmd.run' ] ( cmd ) . find ( ':{0} ' . format ( chain ) ) #NEWLINE# if ( out != ( - 1 ) ) : #NEWLINE# #INDENT# out = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# out = False #NEWLINE# #UNINDENT# return out