66"""
77
88# internal modules
9+ from textual .widgets import DataTable , Footer , Button
10+ from textual .widgets import Label , Input , LoadingIndicator
11+ from textual .screen import ModalScreen
12+ from textual .containers import Horizontal , Vertical
13+ from textual .app import App , ComposeResult
14+ from textual import on , work
15+ import psutil
16+ import botocore
17+ import boto3
18+ import duckdb
19+ import requests
20+ import inquirer
921import sys
1022import os
1123import argparse
5062warnings .filterwarnings ("ignore" , category = ResourceWarning )
5163
5264# stuff from pypi
53- import inquirer
54- import requests
55- import duckdb
56- import boto3
57- import botocore
58- import psutil
59-
60- from textual import on , work
61- from textual .app import App , ComposeResult
62- from textual .containers import Horizontal , Vertical
63- from textual .screen import ModalScreen
64- from textual .widgets import Label , Input , LoadingIndicator
65- from textual .widgets import DataTable , Footer , Button
6665
6766
6867class ConfigManager :
@@ -586,7 +585,8 @@ def set_aws(self, aws: 'AWSBoto'):
586585 print (' ...region is valid\n ' )
587586 else :
588587 print (' ...region is NOT valid\n ' )
589- print ('\n You can configure aws credentials and region using the command:' )
588+ print (
589+ '\n You can configure aws credentials and region using the command:' )
590590 print (' froster config --aws\n ' )
591591 return False
592592
@@ -634,7 +634,7 @@ def set_aws(self, aws: 'AWSBoto'):
634634 print (
635635 '\n You can configure aws credentials and region using the command:' )
636636 print (' froster config --aws\n ' )
637-
637+
638638 return False
639639
640640 if region != aws_profile_region :
@@ -857,7 +857,7 @@ def set_s3(self, aws: "AWSBoto"):
857857
858858 print (
859859 f'Checking AWS credentials for profile "{ self .aws_profile } "...' )
860- if aws .check_credentials ():
860+ if aws .check_credentials (aws_profile = self . aws_profile ):
861861 print (' ...AWS credentials are valid\n ' )
862862 else :
863863 print (' ...AWS credentials are NOT valid\n ' )
@@ -893,7 +893,8 @@ def set_s3(self, aws: "AWSBoto"):
893893 return False
894894
895895 # Create new bucket
896- aws .create_bucket (bucket_name = new_bucket_name )
896+ aws .create_bucket (bucket_name = new_bucket_name ,
897+ region = self .aws_region )
897898
898899 # Store new aws s3 bucket in the config object
899900 self .__set_configuration_entry (
@@ -904,7 +905,7 @@ def set_s3(self, aws: "AWSBoto"):
904905
905906 # Get the archive directory in the selected bucket
906907 archive_dir = inquirer .text (
907- message = 'Enter the archive directory name inside your S3 bucket' ,
908+ message = 'Enter the directory name inside S3 bucket (default= "froster") ' ,
908909 default = 'froster' ,
909910 validate = self .__inquirer_check_required )
910911
@@ -1160,7 +1161,7 @@ def set_slurm(self, args):
11601161 print (f'\n *** SLURM NOT FOUND: Nothing to configure ***\n ' )
11611162
11621163 return True
1163-
1164+
11641165 except :
11651166 print_error ()
11661167 return False
@@ -1275,7 +1276,8 @@ def check_credentials(self,
12751276
12761277 elif aws_profile :
12771278 # Build a new STS client with the provided profile
1278- sts = boto3 .Session (profile_name = aws_profile , region_name = aws_region_name ).client ('sts' )
1279+ sts = boto3 .Session (profile_name = aws_profile ,
1280+ region_name = aws_region_name ).client ('sts' )
12791281
12801282 elif hasattr (self , 's3_client' ):
12811283 # Get the current sts_client
@@ -6107,7 +6109,6 @@ def subcmd_config(args, cfg: ConfigManager, aws: AWSBoto):
61076109 ''' ))
61086110 return
61096111
6110-
61116112 if not cfg .set_nih ():
61126113 return
61136114
0 commit comments