From 365f3dc9d973aa07910c781d7471f27124d2e478 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 5 Jul 2017 11:02:22 -0400 Subject: [PATCH] switched to elif --- contrib/inventory/ec2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/inventory/ec2.py b/contrib/inventory/ec2.py index 5b30c90104..ca81ef0d76 100755 --- a/contrib/inventory/ec2.py +++ b/contrib/inventory/ec2.py @@ -656,11 +656,11 @@ class Ec2Inventory(object): if e.error_code == 'AuthFailure': error = self.get_auth_error_message() - if e.error_code == "OptInRequired": + elif e.error_code == "OptInRequired": error = "RDS hasn't been enabled for this account yet. " \ "You must either log in to the RDS service through the AWS console to enable it, " \ "or set 'rds = False' in ec2.ini" - if not e.reason == "Forbidden": + elif not e.reason == "Forbidden": error = "Looks like AWS RDS is down:\n%s" % e.message self.fail_with_error(error, 'getting RDS instances') @@ -742,11 +742,11 @@ class Ec2Inventory(object): if e.error_code == 'AuthFailure': error = self.get_auth_error_message() - if e.error_code == "OptInRequired": + elif e.error_code == "OptInRequired": error = "ElastiCache hasn't been enabled for this account yet. " \ "You must either log in to the ElastiCache service through the AWS console to enable it, " \ "or set 'elasticache = False' in ec2.ini" - if not e.reason == "Forbidden": + elif not e.reason == "Forbidden": error = "Looks like AWS ElastiCache is down:\n%s" % e.message self.fail_with_error(error, 'getting ElastiCache clusters')