#NEWLINE# def _policies_list( request , expand_rule , **kwargs ) : #NEWLINE# #INDENT# policies = neutronclient ( request ) . list_firewall_policies ( ** kwargs ) . get ( 'firewall_policies' ) #NEWLINE# if expand_rule : #NEWLINE# #INDENT# rules = _rules_list ( request , expand_policy = False ) #NEWLINE# rule_dict = SortedDict ( ( ( rule . id , rule ) for rule in rules ) ) #NEWLINE# for p in expand_rule : #NEWLINE# #INDENT# p [ 'rules' ] = [ rule_dict . get ( rule ) for rule in p [ 'firewall_rules' ] ] #NEWLINE# #UNINDENT# #UNINDENT# return [ Policy ( p ) for p in policies ]