code: def fill_fw_dict_from_db(self, fw_data):
          
          rule_dict = fw_data.get('rules').get('rules')
          fw_dict = {'fw_id': fw_data.get('fw_id'),
                     'fw_name': fw_data.get('name'),
                     'firewall_policy_id': fw_data.get('firewall_policy_id'),
                     'fw_type': fw_data.get('fw_type'),
                     'router_id': fw_data.get('router_id'), 'rules': {}}
          for rule in rule_dict:
              fw_dict['rules'][rule] = rule_dict.get(rule)
          return fw_dict
docs: This routine is called to create a local fw_dict with data from DB.