def METHOD_NAME(context, service_list, machine_name):
    token = context.pro_config.contract_token
    config_override = {token: {}}  # type: Dict[str, Any]
    for service in service_list.split(","):
        config_override[token][service] = {
            "directives": {
                "aptURL": "http://{}:{}".format(
                    context.machines[machine_name].instance.ip,
                    context.service_mirror_cfg[service.replace("-", "_")][
                        "port"
                    ],
                )
            }
        }
    context.text = yaml.dump(config_override)
    contract_override_path = "/tmp/contract-override"
    when_i_create_file_with_content(
        context,
        contract_override_path,
        machine_name=machine_name,
    )
    context.service_mirror_cfg["contract_override"] = contract_override_path