def _create_target_userspace(context, packages, target_repoids): """Create the target userspace.""" prepare_target_userspace(context, constants.TARGET_USERSPACE, target_repoids, list(packages)) _prep_repository_access(context, constants.TARGET_USERSPACE) dnfplugin.install(constants.TARGET_USERSPACE) # and do not forget to set the rhsm into the container mode again with mounting.NspawnActions(constants.TARGET_USERSPACE) as target_context: rhsm.set_container_mode(target_context)
def _create_target_userspace(context, packages, files, target_repoids): """Create the target userspace.""" prepare_target_userspace(context, _get_target_userspace(), target_repoids, list(packages)) _prep_repository_access(context, _get_target_userspace()) _copy_files(context, files) dnfplugin.install(_get_target_userspace()) # and do not forget to set the rhsm into the container mode again with mounting.NspawnActions(_get_target_userspace()) as target_context: rhsm.set_container_mode(target_context)
def _gather_target_repositories(context, rhsm_info, prod_cert_path): """ This is wrapper function to gather the target repoids. Probably the function could be partially merged into gather_target_repositories and this could be really just wrapper with the switch of certificates. I am keeping that for now as it is as interim step. """ rhsm.set_container_mode(context) rhsm.switch_certificate(context, rhsm_info, prod_cert_path) return gather_target_repositories(context)
def _gather_target_repositories(context, indata, prod_cert_path): """ This is wrapper function to gather the target repoids. Probably the function could be partially merged into gather_target_repositories and this could be really just wrapper with the switch of certificates. I am keeping that for now as it is as interim step. :param context: the container where the repofiles should be copied :type context: mounting.IsolatedActions class :param indata: majority of input data for the actor :type indata: class _InputData :param prod_cert_path: path where the target product cert is stored :type prod_cert_path: string """ rhsm.set_container_mode(context) rhsm.switch_certificate(context, indata.rhsm_info, prod_cert_path) if indata.rhui_info: rhui.copy_rhui_data(context, indata.rhui_info.provider) _install_custom_repofiles(context, indata.custom_repofiles) return gather_target_repositories(context, indata)