Search in sources :

Example 1 with SeLinuxMode

use of org.ovirt.engine.api.model.SeLinuxMode in project ovirt-engine by oVirt.

the class HostMapper method map.

@Mapping(from = VDS.class, to = SeLinux.class)
public static SeLinux map(VDS entity, SeLinux template) {
    SeLinux model = template != null ? template : new SeLinux();
    if (entity.getSELinuxEnforceMode() == null) {
        return model;
    }
    SeLinuxMode mode = null;
    switch(entity.getSELinuxEnforceMode()) {
        case DISABLED:
            mode = SeLinuxMode.DISABLED;
            break;
        case PERMISSIVE:
            mode = SeLinuxMode.PERMISSIVE;
            break;
        case ENFORCING:
            mode = SeLinuxMode.ENFORCING;
    }
    model.setMode(mode);
    return model;
}
Also used : SeLinuxMode(org.ovirt.engine.api.model.SeLinuxMode) SeLinux(org.ovirt.engine.api.model.SeLinux)

Aggregations

SeLinux (org.ovirt.engine.api.model.SeLinux)1 SeLinuxMode (org.ovirt.engine.api.model.SeLinuxMode)1