Skip to content

Commit

Permalink
Merge pull request #119 from dirkpetersen:issue-104-ceph-s3-configura…
Browse files Browse the repository at this point in the history
…tion

issue-104 add option "Enter bucket name" for Ceph provider
  • Loading branch information
victormachadoperez authored Jun 30, 2024
2 parents ab24dbf + 65e48fe commit fd97b2e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions froster/froster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,9 @@ def set_s3(self, aws: "AWSBoto"):
# Add an option to create a new bucket
s3_buckets.insert(0, '+ Create new bucket')

if self.provider == 'Ceph':
s3_buckets.insert(0, '+ Enter bucket name')

# Ask user to choose an existing aws s3 bucket or create a new one
s3_bucket = inquirer.list_input(
"Choose your s3 bucket",
Expand Down Expand Up @@ -1299,6 +1302,16 @@ def set_s3(self, aws: "AWSBoto"):
# Store new aws s3 bucket in the config object
self.__set_configuration_entry(
self.profile, 'bucket_name', new_bucket_name)

elif s3_bucket == '+ Enter bucket name':
# Get bucket name
bucket_name = inquirer.text(
message='Enter bucket name',
validate=self.__inquirer_check_required)

# Store the s3 bucket in the config object
self.__set_configuration_entry(
self.profile, 'bucket_name', bucket_name)
else:
# Store aws s3 bucket in the config object
self.__set_configuration_entry(
Expand Down

0 comments on commit fd97b2e

Please sign in to comment.