def create_buckets(project_id, buckets): """Create buckets.""" gsutil = common.Gsutil() for bucket in buckets: try: gsutil.run('defstorageclass', 'get', 'gs://' + bucket) except common.GsutilError: # Create the bucket if it does not exist. gsutil.run('mb', '-p', project_id, 'gs://' + bucket)
def create_buckets(project_id, buckets): """Create buckets.""" gsutil = common.Gsutil() for bucket in buckets: try: gsutil.run("defstorageclass", "get", "gs://" + bucket) except common.GsutilError: # Create the bucket if it does not exist. gsutil.run("mb", "-p", project_id, "gs://" + bucket)
def set_cors(config_dir, buckets): """Sets cors settings.""" gsutil = common.Gsutil() cors_file_path = os.path.join(config_dir, 'gae', 'cors.json') for bucket in buckets: gsutil.run('cors', 'set', cors_file_path, 'gs://' + bucket)
def set_cors(config_dir, buckets): """Sets cors settings.""" gsutil = common.Gsutil() cors_file_path = os.path.join(config_dir, "gae", "cors.json") for bucket in buckets: gsutil.run("cors", "set", cors_file_path, "gs://" + bucket)