diff options
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 2 | ||||
| -rw-r--r-- | nova/compute/instance_types.py | 4 | ||||
| -rw-r--r-- | nova/compute/monitor.py | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index e6146231c..48f8b7b0e 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -239,7 +239,7 @@ class API(base.Base): # Set sane defaults if not specified updates = dict(hostname=self.hostname_factory(instance_id)) if (not hasattr(instance, 'display_name') or - instance.display_name == None): + instance.display_name is None): updates['display_name'] = "Server %s" % instance_id instance = self.update(context, instance_id, **updates) diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index f893f8478..98b4425c8 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -61,7 +61,7 @@ def create(name, memory, vcpus, local_gb, flavorid, swap=0, def destroy(name): """Marks instance types as deleted.""" - if name == None: + if name is None: raise exception.InvalidInputException(_("No instance type specified")) else: try: @@ -73,7 +73,7 @@ def destroy(name): def purge(name): """Removes instance types from database.""" - if name == None: + if name is None: raise exception.InvalidInputException(_("No instance type specified")) else: try: diff --git a/nova/compute/monitor.py b/nova/compute/monitor.py index 04e08a235..3bb54a382 100644 --- a/nova/compute/monitor.py +++ b/nova/compute/monitor.py @@ -260,7 +260,7 @@ class Instance(object): try: data = self.fetch_cpu_stats() - if data != None: + if data is not None: LOG.debug('CPU: %s', data) update_rrd(self, 'cpu', data) @@ -313,7 +313,7 @@ class Instance(object): LOG.debug('CPU: %d', self.cputime) # Skip calculation on first pass. Need delta to get a meaningful value. - if cputime_last_updated == None: + if cputime_last_updated is None: return None # Calculate the number of seconds between samples. |
