Skip to content

Commit 6050b18

Browse files
authored
Merge pull request #367 from basecamp/fix-default-retention
Handle the bucket_detail.object_lock_config default of null
2 parents 32533e5 + 6602f12 commit 6050b18

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugins/modules/purefb_bucket.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,12 @@ def update_bucket(module, blade, bucket):
513513
bucket_detail.object_lock_config, "freeze_locked_objects", False
514514
):
515515
module.warn("Freeze locked onjects cannot be disabled.")
516-
if getattr(bucket_detail.object_lock_config, "default_retention", 0) > 1:
516+
default_retention = getattr(
517+
bucket_detail.object_lock_config, "default_retention"
518+
)
519+
if default_retention and default_retention > 1:
517520
if (
518-
bucket_detail.object_lock_config.default_retention / 86400000
519-
> int(module.params["default_retention"])
521+
default_retention / 86400000 > int(module.params["default_retention"])
520522
and bucket_detail.retention_lock == "ratcheted"
521523
):
522524
module.warn(

0 commit comments

Comments
 (0)