From a1a8ac7286ab30c2888b879bc16ecd2bd91dd1d7 Mon Sep 17 00:00:00 2001 From: Jon Beilke Date: Wed, 3 Oct 2018 01:26:09 -0500 Subject: [PATCH] check for None in lifecycle actions --- moto/s3/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moto/s3/models.py b/moto/s3/models.py index fc977bb99..39f36982d 100644 --- a/moto/s3/models.py +++ b/moto/s3/models.py @@ -425,23 +425,23 @@ class FakeBucket(BaseModel): nve_noncurrent_days = None if rule.get('NoncurrentVersionExpiration'): - if not rule["NoncurrentVersionExpiration"].get('NoncurrentDays'): + if rule["NoncurrentVersionExpiration"].get('NoncurrentDays') is None: raise MalformedXML() nve_noncurrent_days = rule["NoncurrentVersionExpiration"]["NoncurrentDays"] nvt_noncurrent_days = None nvt_storage_class = None if rule.get('NoncurrentVersionTransition'): - if not rule["NoncurrentVersionTransition"].get('NoncurrentDays'): + if rule["NoncurrentVersionTransition"].get('NoncurrentDays') is None: raise MalformedXML() - if not rule["NoncurrentVersionTransition"].get('StorageClass'): + if rule["NoncurrentVersionTransition"].get('StorageClass') is None: raise MalformedXML() nvt_noncurrent_days = rule["NoncurrentVersionTransition"]["NoncurrentDays"] nvt_storage_class = rule["NoncurrentVersionTransition"]["StorageClass"] aimu_days = None if rule.get('AbortIncompleteMultipartUpload'): - if not rule["AbortIncompleteMultipartUpload"].get('DaysAfterInitiation'): + if rule["AbortIncompleteMultipartUpload"].get('DaysAfterInitiation') is None: raise MalformedXML() aimu_days = rule["AbortIncompleteMultipartUpload"]["DaysAfterInitiation"]