From nobody Thu Dec 26 10:22:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) client-ip=66.187.230.42; envelope-from=kimchi-devel-bounces@ovirt.org; helo=lists.ovirt.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) smtp.mailfrom=kimchi-devel-bounces@ovirt.org; Return-Path: Received: from lists.ovirt.org (lists.phx.ovirt.org [66.187.230.42]) by mx.zohomail.com with SMTPS id 149063435982539.53426943307704; Mon, 27 Mar 2017 10:05:59 -0700 (PDT) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id 5C7F882081B; Mon, 27 Mar 2017 17:05:58 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lists.ovirt.org (Postfix) with ESMTPS id E612C820818 for ; Mon, 27 Mar 2017 17:05:50 +0000 (UTC) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2RH4Wx7091738 for ; Mon, 27 Mar 2017 13:05:50 -0400 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 29f2u957qv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 27 Mar 2017 13:05:49 -0400 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Mar 2017 14:05:48 -0300 Received: from d24relay04.br.ibm.com (9.18.232.146) by e24smtp05.br.ibm.com (10.172.0.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 27 Mar 2017 14:05:46 -0300 Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay04.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2RH5kdb36438270 for ; Mon, 27 Mar 2017 14:05:46 -0300 Received: from d24av03.br.ibm.com (localhost [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v2RH5knX021782 for ; Mon, 27 Mar 2017 14:05:47 -0300 Received: from alinefm-TP440.br.ibm.com (alinefm-tp440.br.ibm.com [9.18.239.40]) by d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v2RH5koJ021779 for ; Mon, 27 Mar 2017 14:05:46 -0300 X-Original-To: kimchi-devel@ovirt.org From: Aline Manera To: Kimchi Devel Date: Mon, 27 Mar 2017 14:05:45 -0300 X-Mailer: git-send-email 2.9.3 X-TM-AS-MML: disable x-cbid: 17032717-0032-0000-0000-0000054E921E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032717-0033-0000-0000-000011D2D15D Message-Id: <20170327170545.19146-1-alinefm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-27_15:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703270143 Subject: [Kimchi-devel] [PATCH] [Kimchi] Bug fix 1119: Proper check NetworkManager is running when creating new network X-BeenThere: kimchi-devel@ovirt.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: kimchi-devel-bounces@ovirt.org Errors-To: kimchi-devel-bounces@ovirt.org X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It was relying on Capabilities to verify NetworkManager was running or not. But the Capabilities value is only updated on lookup() which was leading on a wrong assumption. To fix that, call FeatureTests function directly. Signed-off-by: Aline Manera --- model/networks.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/model/networks.py b/model/networks.py index eb1590e..b653b23 100644 --- a/model/networks.py +++ b/model/networks.py @@ -33,7 +33,7 @@ from wok.plugins.gingerbase.netinfo import get_vlan_devic= e, is_bridge, is_vlan from wok.plugins.gingerbase.netinfo import ports from wok.plugins.kimchi import network as knetwork from wok.plugins.kimchi.config import kimchiPaths -from wok.plugins.kimchi.model.config import CapabilitiesModel +from wok.plugins.kimchi.model.featuretests import FeatureTests from wok.plugins.kimchi.osinfo import defaults as tmpl_defaults from wok.plugins.kimchi.xmlutils.interface import get_iface_xml from wok.plugins.kimchi.xmlutils.network import create_linux_bridge_xml @@ -52,8 +52,6 @@ class NetworksModel(object): if self.conn.isQemuURI(): self._check_default_networks() =20 - self.caps =3D CapabilitiesModel(**kargs) - def _check_default_networks(self): networks =3D list(set(tmpl_defaults.get('networks', []))) =20 @@ -228,7 +226,7 @@ class NetworksModel(object): # connection =3D=3D macvtap and iface is not bridge elif netinfo.is_bare_nic(iface) or netinfo.is_bonding(iface): # libvirt bridge creation will fail with NetworkManager enabled - if self.caps.nm_running: + if FeatureTests.is_nm_running(): raise InvalidParameter('KCHNET0027E') =20 if 'vlan_id' in params: --=20 2.9.3 _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel