fix(cmd/fw): why to fucking log when it is printed by the only caller

This commit is contained in:
2026-02-15 04:44:58 +03:00
parent 9dc0b6002e
commit a2268fda5d

View File

@@ -94,7 +94,6 @@ func (f *Firewalld) PortClose(port int, protocol string) error {
// #nosec G204 - handle is extracted from nftables output and validated // #nosec G204 - handle is extracted from nftables output and validated
if port >= 0 && port <= 65535 { if port >= 0 && port <= 65535 {
if protocol != "tcp" && protocol != "udp" { if protocol != "tcp" && protocol != "udp" {
f.logger.Error("invalid protocol")
return fmt.Errorf("invalid protocol") return fmt.Errorf("invalid protocol")
} }
s := strconv.Itoa(port) s := strconv.Itoa(port)
@@ -106,13 +105,11 @@ func (f *Firewalld) PortClose(port int, protocol string) error {
) )
output, err := cmd.CombinedOutput() output, err := cmd.CombinedOutput()
if err != nil { if err != nil {
f.logger.Error(err.Error())
return err return err
} }
f.logger.Info("Remove port " + s + " " + string(output)) f.logger.Info("Remove port " + s + " " + string(output))
output, err = exec.Command("firewall-cmd", "--reload").CombinedOutput() output, err = exec.Command("firewall-cmd", "--reload").CombinedOutput()
if err != nil { if err != nil {
f.logger.Error(err.Error())
return err return err
} }
f.logger.Info("Reload " + string(output)) f.logger.Info("Reload " + string(output))