Report underlying integer for unknown capabilities

Ieb1ea2ab45d76fc838c11489c2b029d7a5295e0e added a fix to report unknown
capabilities as "CAP_UNDEFINED".  This change improves on that slightly
to use `str(c)` for undefined capabilities rather than losing
information.  This also better parallels the oslo.config "input"
behaviour in `priv_context.CapNameOrInt`

Change-Id: Ic59576a4eba7bb8d40aee9e3d383417386aa08aa
This commit is contained in:
Angus Lees
2016-08-19 14:15:21 +10:00
parent 9b54cb6b03
commit f22a6a1eeb

View File

@@ -380,7 +380,7 @@ class Daemon(object):
def fmt_caps(capset):
if not capset:
return 'none'
fc = [capabilities.CAPS_BYVALUE.get(c, 'CAP_UNDEFINED')
fc = [capabilities.CAPS_BYVALUE.get(c, str(c))
for c in capset]
fc.sort()
return '|'.join(fc)