Skip to content

Commit 322ea1e

Browse files
committed
Adding pass for S3 based URL's
1 parent 720019f commit 322ea1e

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

cli/cfncluster/config_sanity.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import boto.ec2
1515
import boto.vpc
1616
import urllib2
17+
from urlparse import urlparse
1718
import boto.exception
1819
import sys
1920

@@ -76,14 +77,18 @@ def check_resource(region, aws_access_key_id, aws_secret_access_key, resource_ty
7677
sys.exit(1)
7778
# URL
7879
elif resource_type == 'URL':
79-
try:
80-
urllib2.urlopen(resource_value)
81-
except urllib2.HTTPError, e:
82-
print(e.code)
83-
sys.exit(1)
84-
except urllib2.URLError, e:
85-
print(e.args)
86-
sys.exit(1)
80+
scheme = urlparse(resource_value).scheme
81+
if scheme == 's3':
82+
pass
83+
else:
84+
try:
85+
urllib2.urlopen(resource_value)
86+
except urllib2.HTTPError, e:
87+
print(e.code)
88+
sys.exit(1)
89+
except urllib2.URLError, e:
90+
print(e.args)
91+
sys.exit(1)
8792
# EC2 EBS Snapshot Id
8893
elif resource_type == 'EC2Snapshot':
8994
try:

0 commit comments

Comments
 (0)