From 6291af275084db4fbda8803f794729b6a0f1ace3 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Fri, 10 Aug 2012 10:40:35 +0100 Subject: maint: compare singletons with 'is' not '==' Looks like newer pep8 will get checks for these: https://github.com/jcrocholl/pep8/commit/b04975dc Using 'is' is slightly faster anyway :) Change-Id: Id14951791991cca919b54ed747ff99fb66aa3352 --- nova/compute/api.py | 2 +- nova/volume/storwize_svc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index b7aa99d45..078b17106 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -792,7 +792,7 @@ class API(base.Base): # only going to create 1 instance. # This speeds up API responses for builds # as we don't need to wait for the scheduler. - create_instance_here = max_count == 1 or max_count == None + create_instance_here = max_count == 1 or max_count is None (instances, reservation_id) = self._create_instance( context, instance_type, diff --git a/nova/volume/storwize_svc.py b/nova/volume/storwize_svc.py index f5a3ed602..f87500f9b 100644 --- a/nova/volume/storwize_svc.py +++ b/nova/volume/storwize_svc.py @@ -413,7 +413,7 @@ class StorwizeSVCDriver(san.SanISCSIDriver): else: size = default_size - if getattr(FLAGS, 'storwize_svc_vol_autoexpand') == True: + if getattr(FLAGS, 'storwize_svc_vol_autoexpand'): autoexpand = '-autoexpand' else: autoexpand = '' -- cgit