'Unload a kext by forking into kextunload.'

def LegacyKextunload(self, cf_bundle_identifier):

    error_code = OS_SUCCESS
    bundle_identifier = self.CFStringToPystring(cf_bundle_identifier)
    try:
        subprocess.check_call(['/sbin/kextunload', '-b', bundle_identifier])
    except subprocess.CalledProcessError as cpe:
        logging.debug('failed    to    unload    {0}:{1}'.format(bundle_identifier, str(cpe)))
        error_code = (-1)
    return error_code
