(self)
| 316 | return True |
| 317 | |
| 318 | def set_minio_credentials(self): |
| 319 | use_docker_minio = bcolors.inputcolor('Would you like to provide a custom MinIO host? Default will use docker Y/N?') |
| 320 | if use_docker_minio.lower() != 'y': |
| 321 | self.use_docker_minio = True |
| 322 | self.s3_endpoint_url = 'http://minio:9000' |
| 323 | self.s3_access_id = create_random_string(20) |
| 324 | self.s3_access_secret = create_random_string(40) |
| 325 | else: |
| 326 | self.use_docker_minio = False |
| 327 | # Ask For Endpoint Url |
| 328 | if not self.use_docker_minio: |
| 329 | is_valid = False |
| 330 | while not is_valid: |
| 331 | s3_endpoint_url = bcolors.inputcolor('Please provide the Minio Endpoint Url: ') |
| 332 | if s3_endpoint_url == '': |
| 333 | bcolors.printcolor('Please a enter a valid value.', bcolors.WARNING) |
| 334 | continue |
| 335 | else: |
| 336 | self.s3_endpoint_url = s3_endpoint_url |
| 337 | is_valid = True |
| 338 | |
| 339 | # Ask For Access Key ID |
| 340 | if not self.use_docker_minio: |
| 341 | is_valid = False |
| 342 | while not is_valid: |
| 343 | s3_access_id = bcolors.inputcolor('Please provide the Minio Access Key ID: ') |
| 344 | if s3_access_id == '': |
| 345 | bcolors.printcolor('Please a enter a valid value.', bcolors.WARNING) |
| 346 | continue |
| 347 | else: |
| 348 | self.s3_access_id = s3_access_id |
| 349 | is_valid = True |
| 350 | |
| 351 | # Ask For Access Key Secret |
| 352 | is_valid = False |
| 353 | |
| 354 | while not is_valid: |
| 355 | s3_access_secret = bcolors.inputcolor('Please provide the Minio Access Key Secret: ') |
| 356 | if s3_access_secret == '': |
| 357 | bcolors.printcolor('Please a enter a valid value.', bcolors.WARNING) |
| 358 | continue |
| 359 | else: |
| 360 | self.s3_access_secret = s3_access_secret |
| 361 | is_valid = True |
| 362 | |
| 363 | # Ask for bucket name |
| 364 | bucket_name = bcolors.inputcolor('Please provide the Minio S3 Bucket Name [Default is diffgram-storage]: ') |
| 365 | if bucket_name == '': |
| 366 | self.bucket_name = 'diffgram-storage' |
| 367 | else: |
| 368 | self.bucket_name = bucket_name |
| 369 | |
| 370 | # Ask for bucket region |
| 371 | if not self.use_docker_minio: |
| 372 | is_valid = False |
| 373 | while not is_valid: |
| 374 | bucket_region = bcolors.inputcolor('Please provide the Minio S3 Bucket Region: ') |
| 375 | if bucket_region == '': |
no test coverage detected