From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues Subject: Re: [PATCH] KVM-test: kvm.py: Code style fix Date: Tue, 08 Jun 2010 15:22:08 -0300 Message-ID: <1276021328.2553.5.camel@freedom> References: <20100608080224.GA20396@t4.rh> <4C0E8300.9000001@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: autotest@test.kernel.org, Marc Enthus , kvm@vger.kernel.org To: Michael Goldish Return-path: In-Reply-To: <4C0E8300.9000001@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org On Tue, 2010-06-08 at 20:50 +0300, Michael Goldish wrote: > On 06/08/2010 11:02 AM, Marc Enthus wrote: > > From: Marc Enthus > > > > According to autotest coding style > > and http://www.python.org/dev/peps/pep-0008/ > > > > use > > if pa_type is not None: > > instead of > > if pa_type: > > > > Signed-off-by: Marc Enthus > > --- > > client/tests/kvm/kvm_vm.py | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py > > index f3ce4d6..0080b15 100755 > > --- a/client/tests/kvm/kvm_vm.py > > +++ b/client/tests/kvm/kvm_vm.py > > @@ -516,7 +516,7 @@ class VM: > > pa_type) > > return False > > > > - elif pa_type and pa_type != "no": > > + elif pa_type is not None and pa_type != "no": > > logging.warn("Unsupported pci_assignable type: %s", pa_type) > > > > # Make qemu command > > > > > > The condition 'if pa_type' is meant to exclude both None and "". Both > are possible and both indicate that the user isn't interested in pa_type > at all. In that case 'if pa_type' conforms to PEP 8 AFAIK. I'm not > sure about the autotest coding style though. Yes, turns out I have overlooked the possibility of pa_type being "". I'll revert this fix, thanks for pointing this out!