#NEWLINE# def parse_firewall( rule ) : #NEWLINE# #INDENT# '\n    Parse the firewall line\n    ' #NEWLINE# parser = argparse . ArgumentParser ( ) #NEWLINE# rules = shlex . split ( rule ) #NEWLINE# rules . pop ( 0 ) #NEWLINE# parser . add_argument ( '--enable' , '--enabled' , dest = 'enable' , action = 'store_true' ) #NEWLINE# parser . add_argument ( '--disable' , '--disabled' , dest = 'disable' , action = 'store_true' ) #NEWLINE# parser . add_argument ( '--port' , dest = 'port' , action = 'store' ) #NEWLINE# parser . add_argument ( '--service' , dest = 'service' , action = 'store' ) #NEWLINE# parser . add_argument ( '--ssh' , dest = 'ssh' , action = 'store_true' ) #NEWLINE# parser . add_argument ( '--smtp' , dest = 'smtp' , action = 'store_true' ) #NEWLINE# parser . add_argument ( '--http' , dest = 'http' , action = 'store_true' ) #NEWLINE# parser . add_argument ( '--ftp' , dest = 'ftp' , action = 'store_true' ) #NEWLINE# args = clean_args ( vars ( parser . parse_args ( rules ) ) ) #NEWLINE# parser = None #NEWLINE# return args