Skip to content

Commit 8de84ab

Browse files
authored
Merge pull request #69 from rthill91/fix-empty-share
fix: do not attempt to share image with empty list
2 parents 8971bf5 + e9f5ff5 commit 8de84ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

awspub/image.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ def _share(self, share_conf: List[str], images: Dict[str, _ImageInfo]):
189189
"""
190190
share_list = self._share_list_filtered(share_conf)
191191

192+
if not share_list:
193+
logger.info("no valid accounts found for sharing in this partition, skipping")
194+
return
195+
192196
for region, image_info in images.items():
193197
ec2client: EC2Client = boto3.client("ec2", region_name=region)
194198
# modify image permissions

0 commit comments

Comments
 (0)