Bug 845257
Summary: | Enabling service that's already enabled fails with ALREADY_ENABLED | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Stef Walter <stefw> | ||||||
Component: | firewalld | Assignee: | Thomas Woerner <twoerner> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | rawhide | CC: | brian.murrell, jpopelka, twoerner | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | firewalld-0.2.9-1.fc18 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 1366667 (view as bug list) | Environment: | |||||||
Last Closed: | 2013-02-15 12:18:38 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1366654, 1366667, 1420457 | ||||||||
Attachments: |
|
Description
Stef Walter
2012-08-02 13:30:02 UTC
Oh, and ditto for --remove: [stef@stef-rawhide ~]$ firewall-cmd --service=mdns --remove [stef@stef-rawhide ~]$ firewall-cmd --service=mdns --remove Error: NOT_ENABLED [stef@stef-rawhide ~]$ echo $? 254 Created attachment 621016 [details]
patch
I actually tend to agree with Stef that re-adding and re-removing of services/ports etc. shouldn't be considered as error.
Thomas, can you check the attached patch ?
With the patch the ALREADY_ENABLED and NOT_ENABLED errors are not sent over D-Bus to whoever tries to re-add or re-remove a service/port etc.
They are now used for internal indication only.
Or if you don't like the patch we can simply change firewall-cmd to ignore these errors, like:
diff --git a/src/firewall-cmd b/src/firewall-cmd
@@ -573,7 +573,11 @@ except dbus.DBusException as e:
code = UNKNOWN_ERROR
print("Error: %s" % e)
else:
- print("Error: %s" % e.message)
+ if code == ALREADY_ENABLED or code == NOT_ENABLED:
+ print("Warning: %s" % e.message)
+ sys.exit(0)
+ else:
+ print("Error: %s" % e.message)
sys.exit(code)
Created attachment 621020 [details]
the same should apply to re-adding / re-removing interface to/from zone
Fixed in GIT: http://git.fedorahosted.org/cgit/firewalld.git/commit/?id=c7748d4a6becda325bd4986cb0315d43ed28f73e Did this somehow come back? # /usr/bin/firewall-cmd --add-port=123/udp Error: ALREADY_ENABLED: '123:udp' already in 'public' # echo $? 11 # rpm -q firewalld firewalld-0.4.3.2-3.el7.noarch Doesn't seem to happen on RHEL 7.2: # /usr/bin/firewall-cmd --add-port=123/udp success # /usr/bin/firewall-cmd --add-port=123/udp Warning: ALREADY_ENABLED # rpm -q firewalld firewalld-0.3.9-14.el7.noarch |