File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 66import os
77import yaml
88import time
9- import logging
109import re
1110
1211
@@ -31,9 +30,12 @@ def run_shell_command(command, env_vars=None):
3130 try :
3231 output = subprocess .check_output (command , stderr = subprocess .STDOUT , env = env )
3332 print (f"Command output: { output .decode ()} " )
34- except Exception as e :
33+ except subprocess . CalledProcessError as e :
3534 print (f"Error executing command: { e .output .decode ()} " )
3635 raise
36+ except Exception as e :
37+ print (f"Exception executing command: { e !r} " )
38+ raise
3739
3840
3941def validate_alphanumeric (value , name ):
@@ -100,6 +102,8 @@ def main():
100102 parser .add_argument ("type" , choices = ["admin" , "images" , "plugin" ])
101103 args = parser .parse_args ()
102104
105+ accounts = None
106+
103107 if args .type in {"admin" , "images" }:
104108 try :
105109 with open ("config/resources.yaml" , "r" ) as file :
@@ -119,6 +123,9 @@ def main():
119123 except Exception as e :
120124 print (f"Failed to read config data: \n { e } " )
121125
126+ if accounts is None :
127+ raise ValueError (f"Could not load accounts for stack { args .type } " )
128+
122129 for account_name , account_info in accounts .items ():
123130 print (
124131 f"Reading from account { account_name } with ID { account_info ['account_id' ]} "
You can’t perform that action at this time.
0 commit comments