File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2+
23import boto
34import sys
45from boto .s3 .connection import OrdinaryCallingFormat
56
6- conn = boto .connect_s3 (host = '{{ getv "/deis/store/gateway/host" }}' ,
7- port = {{ getv "/deis/store/gateway/port" }},
8- is_secure = False ,
9- calling_format = OrdinaryCallingFormat (),
10- )
11- bucket = sys .argv [1 ]
127
13- if not bucket in conn .get_all_buckets ():
14- conn .create_bucket (bucket )
8+ conn = boto .connect_s3 (
9+ host = '{{ getv "/deis/store/gateway/host" }}' ,
10+ port = {{ getv "/deis/store/gateway/port" }},
11+ is_secure = False ,
12+ calling_format = OrdinaryCallingFormat ())
13+ name = sys .argv [1 ]
14+
15+ if name not in (bucket .name for bucket in conn .get_all_buckets ()):
16+ conn .create_bucket (name )
Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2+
23import boto
34import sys
45from boto .s3 .connection import OrdinaryCallingFormat
56
6- conn = boto .connect_s3 (aws_access_key_id = '{{ getv "/deis/store/gateway/accessKey" }}' ,
7- aws_secret_access_key = '{{ getv "/deis/store/gateway/secretKey " }}' ,
8- host = '{{ getv "/deis/store/gateway/host " }}' ,
9- port = {{ getv "/deis/store/gateway/port " }},
10- is_secure = False ,
11- calling_format = OrdinaryCallingFormat () ,
12- )
13- bucket = sys .argv [1 ]
7+ conn = boto .connect_s3 (
8+ aws_access_key_id = '{{ getv "/deis/store/gateway/accessKey " }}' ,
9+ aws_secret_access_key = '{{ getv "/deis/store/gateway/secretKey " }}' ,
10+ host = ' {{ getv "/deis/store/gateway/host " }}' ,
11+ port = {{ getv "/deis/store/gateway/port" }} ,
12+ is_secure = False ,
13+ calling_format = OrdinaryCallingFormat () )
14+ name = sys .argv [1 ]
1415
15- if not bucket in conn .get_all_buckets ():
16- conn .create_bucket (bucket )
16+ if name not in ( bucket . name for bucket in conn .get_all_buckets () ):
17+ conn .create_bucket (name )
You can’t perform that action at this time.
0 commit comments