def get_fw_dict(self):
fw_dict = {}<EOL>if self.fw_id is None:<EOL><INDENT>return fw_dict<EOL><DEDENT>fw_dict = {'<STR_LIT>': {}, '<STR_LIT>': self.tenant_name,<EOL>'<STR_LIT>': self.tenant_id, '<STR_LIT>': self.fw_id,<EOL>'<STR_LIT>': self.fw_name,<EOL>'<STR_LIT>': self.active_pol_id,<EOL>'<STR_LIT>': self.fw_type, '<STR_LIT>': self.router_id}<EOL>if self.active_pol_id not in self.policies:<EOL><INDENT>return fw_dict<EOL><DEDENT>pol_dict = self.policies[self.active_pol_id]<EOL>for rule in pol_dict['<STR_LIT>']:<EOL><INDENT>fw_dict['<STR_LIT>'][rule] = self.rules[rule]<EOL><DEDENT>return fw_dict<EOL>
This API creates a FW dictionary from the local attributes.