trim capability prefix to allow setting single bit
authorStephen Soltesz <stephen.soltesz@gmail.com>
Sat, 9 Mar 2013 22:16:27 +0000 (17:16 -0500)
committerStephen Soltesz <stephen.soltesz@gmail.com>
Sat, 9 Mar 2013 22:16:27 +0000 (17:16 -0500)
commitb3e6c1ed03bc50f25d03ca8f13aa5bca7419206f
treec340311a94c5bb5f94118f87fc21757131ca7751
parentc80e697622e19555e595be98cbb22fc80e8e182c
trim capability prefix to allow setting single bit

M-Lab has added a new ccapability to enable/disable web100 statistics
collection per vserver. vserverimpl.text2ccaps() recognizes strings such as
"raw_icmp", "vxc_raw_icmp", and "^28" to set a specific bit in the CCaps bit
field, but it does not recognize "vxc_^28".  All bcap and ccap names defined
by util-vserver are recognized with or without the cap_ and vxc_ prefixes.
So, this patch will allow an administrator to enable arbitrary bit fields in
the CCaps or BCaps of a vserver without harming compatibility with existing
capabilities.  The admin would add, for example vxc_^28 or cap_^28, to the
'capabililties' slice tag and the prefixes would be stripped before being
passed to text2*caps() as simply "^28".
python/vserver.py