From nobody Mon Feb 9 01:21:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587562148; cv=none; d=zohomail.com; s=zohoarc; b=GnvTTlTB5LsCfI0fT6nBx8lSOejT/Nhg16MhND1ZI6L9r12k17vKceziG/4qEmz1Qftwx8ImbybptQj6jZMX8/anEMlgvRj9dNGR/TEE3/mU9+OdEgj1IwgIQj5pxNqWu5w1+CoHzAI6Hm37P59cyZjZvEfjp5asdf+Fq3pkJFM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587562148; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TiV9n3KYXyvTulAu/uyZcQRy+qtCiOlTuPIOrZpTqS8=; b=lzRnPD6GHbU4+z/QVqaA6fhjoi53jz6nlriLSgH/fd6aCk1R5sZvaWmuYWe7C5xVHQUaSX6c3w4W1CR6BmJib0qU6t+8BWcdGrteNx8Xp0C2YWbkT7CWfd+Nyzq0McBXQCpf8QjFwKpNe5HzWk6OI6ieWDakgQkqzzzDJij+H2o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1587562148106744.4165661792297; Wed, 22 Apr 2020 06:29:08 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-TjipM5RkMsyOS1Y0-P1jvg-1; Wed, 22 Apr 2020 09:29:03 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DD514100CCC4; Wed, 22 Apr 2020 13:28:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8AF53A4; Wed, 22 Apr 2020 13:28:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 53055180B791; Wed, 22 Apr 2020 13:28:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03MDShp6005849 for ; Wed, 22 Apr 2020 09:28:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id EAF0A6084D; Wed, 22 Apr 2020 13:28:43 +0000 (UTC) Received: from sturgeon.redhat.com (unknown [10.40.192.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FFD46084A; Wed, 22 Apr 2020 13:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587562146; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TiV9n3KYXyvTulAu/uyZcQRy+qtCiOlTuPIOrZpTqS8=; b=MvhfcpRgkwnU3yIJbIwTDBxVJXJtxdCkHonNnHgOQQHpxOrTntukpXmfKXTb0KpN36cPNw f1l0W7pKYZ+W8YihJZ5WorTnaSz0nm1mr/JOmokgv7dvRntQ43ohaxNhaL4cTgtWxFZrfJ ynWHkdiuXQTrrVcpdZti6/3fq8/BNds= X-MC-Unique: TjipM5RkMsyOS1Y0-P1jvg-1 From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt-ci PATCH 07/13] lcitool: Drop the get_flavor() method Date: Wed, 22 Apr 2020 15:28:25 +0200 Message-Id: <7aedaa90fd7cd7aed86769e2b5f62cb22e203039.1587562058.git.eskultet@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Erik Skultety X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We can now access this value directly in the config dictionary. Signed-off-by: Erik Skultety --- guests/lcitool | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index f08bd98..a385c15 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -206,37 +206,12 @@ class Config: if flavor =3D=3D "gitlab": self._validate_section(self.dict, "gitlab", "gitlab_runner_sec= ret") =20 - def get_flavor(self): - flavor_file =3D self._get_config_file("flavor") - - try: - with open(flavor_file, "r") as infile: - flavor =3D infile.readline().strip() - except Exception: - # If the flavor has not been configured, we choose the default - # and store it on disk to ensure consistent behavior from now = on - flavor =3D "test" - try: - with open(flavor_file, "w") as infile: - infile.write("{}\n".format(flavor)) - except Exception as ex: - raise Exception( - "Can't write flavor file ({}): {}".format( - flavor_file, ex - ) - ) - - if flavor not in ["test", "jenkins", "gitlab"]: - raise Exception("Invalid flavor '{}'".format(flavor)) - - return flavor - def get_vault_password_file(self): vault_pass_file =3D None =20 # The vault password is only needed for the jenkins flavor, but in # that case we want to make sure there's *something* in there - if self.get_flavor() =3D=3D "jenkins": + if self.dict["install"]["flavor"] =3D=3D "jenkins": vault_pass_file =3D self._get_config_file("vault-password") =20 try: @@ -535,7 +510,6 @@ class Application: def _execute_playbook(self, playbook, hosts, projects, git_revision): base =3D Util.get_base() =20 - flavor =3D self._config.get_flavor() vault_pass_file =3D self._config.get_vault_password_file() root_pass_file =3D self._config.get_root_password_file() gitlab_url_file =3D self._config.get_gitlab_url_file() @@ -568,7 +542,7 @@ class Application: "base": base, "playbook_base": playbook_base, "root_password_file": root_pass_file, - "flavor": flavor, + "flavor": self._config.dict["install"]["flavor"], "selected_projects": selected_projects, "git_remote": git_remote, "git_branch": git_branch, @@ -617,7 +591,7 @@ class Application: def _action_install(self, args): base =3D Util.get_base() =20 - flavor =3D self._config.get_flavor() + flavor =3D self._config.dict["install"]["flavor"] =20 for host in self._inventory.expand_pattern(args.hosts): facts =3D self._inventory.get_facts(host) --=20 2.25.3