<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def LegacyKextunload(self, cf_bundle_identifier):
 """Unload a kext by forking into kextunload."""

    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 %s:%s', bundle_identifier, str(cpe))
      error_code = -1
    return error_code