Rahul8827 commited on
Commit
b7b3071
·
1 Parent(s): e5688a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,8 +4,6 @@ import os
4
  from datetime import datetime
5
  import boto3
6
 
7
- # Initialize boto3 S3 client
8
- s3 = boto3.client('s3')
9
 
10
  def Create_Organization(org_name, org_handle):
11
  on = org_name
@@ -23,8 +21,11 @@ def Create_Organization(org_name, org_handle):
23
  Organizationdetails[org_handle]['Created_by']=hostname
24
  Organizationdetails[org_handle]['Created_Time']=tim
25
 
 
 
 
 
26
  # Save the organization details to S3 bucket
27
- bucket = s3.Bucket('orgbotrite')
28
  key = 'Organizations/' + org_handle + '/Organizationdetails.json'
29
  blob = bucket.put_object(Key=key, Body=json.dumps(Organizationdetails))
30
 
 
4
  from datetime import datetime
5
  import boto3
6
 
 
 
7
 
8
  def Create_Organization(org_name, org_handle):
9
  on = org_name
 
21
  Organizationdetails[org_handle]['Created_by']=hostname
22
  Organizationdetails[org_handle]['Created_Time']=tim
23
 
24
+ # Create a bucket in S3
25
+ s3 = boto3.client('s3')
26
+ bucket = s3.create_bucket(Bucket='orgbotrite23')
27
+
28
  # Save the organization details to S3 bucket
 
29
  key = 'Organizations/' + org_handle + '/Organizationdetails.json'
30
  blob = bucket.put_object(Key=key, Body=json.dumps(Organizationdetails))
31