Description of problem:
Gluster brick creation fails while running restorecon on the brick mount point
Steps to Reproduce:
1. Go to 'Storage Devices' tab under Hosts
2. Create brick by selecting a storage device.
3. Brick Creation fails.
Brick Creation fails while running restorecon on the brick mount point
Brick creation should succeed with proper selinux context set on the brick mount point.
This is a side effect of bz#1368474. String values encoded as unicode strings in jsonrpc, but selinux python bindings expects a char * as input. mount point should be converted to utf-8 while passing to restorecon.
Tested with RHV-4.0.6 ( version 220.127.116.11-0.1.el7ev ) and I am not seeing the bricks with selinux context.
Looks like the fix is not available with this build. I am waiting for inputs from Ramesh on BZ 1368474 - which also doesn't have the fix in this build
Tested with vdsm-4.18.21-1.el7.centos.x86_64 with oVirt-4.0.6
Creation of bricks from UI sets the proper selinux label on the bricks and succeeds
[root@ ~]# ls -lZd /rhgs/brick1
drwxr-xr-x. root root system_u:object_r:glusterd_brick_t:s0 /rhgs/brick1