code: def cli(env, identifier):
      
  
      mgr = SoftLayer.FirewallManager(env.client)
  
      firewall_type, firewall_id = firewall.parse_id(identifier)
      if firewall_type == 'vlan':
          orig_rules = mgr.get_dedicated_fwl_rules(firewall_id)
      else:
          orig_rules = mgr.get_standard_fwl_rules(firewall_id)
      # open an editor for the user to enter their rules
      edited_rules = open_editor(rules=orig_rules)
      env.out(edited_rules)
      if formatting.confirm("Would you like to submit the rules. "
                            "Continue?"):
          while True:
              try:
                  rules = parse_rules(edited_rules)
                  if firewall_type == 'vlan':
                      rules = mgr.edit_dedicated_fwl_rules(firewall_id,
                                                           rules)
                  else:
                      rules = mgr.edit_standard_fwl_rules(firewall_id,
                                                          rules)
                  break
              except (SoftLayer.SoftLayerError, ValueError) as error:
                  env.out("Unexpected error({%s})" % (error))
                  if formatting.confirm("Would you like to continue editing "
                                        "the rules. Continue?"):
                      edited_rules = open_editor(content=edited_rules)
                      env.out(edited_rules)
                      if formatting.confirm("Would you like to submit the "
                                            "rules. Continue?"):
                          continue
                      else:
                          raise exceptions.CLIAbort('Aborted.')
                  else:
                      raise exceptions.CLIAbort('Aborted.')
                  env.fout('Firewall updated!')
      else:
          raise exceptions.CLIAbort('Aborted.')
docs: Edit firewall rules.