1
- from contentctl .actions .initialize import Initialize
1
+ import traceback
2
+ import sys
3
+ import warnings
4
+ import pathlib
2
5
import tyro
3
- from contentctl .objects .config import init , validate , build , new , deploy_acs , deploy_rest , test , test_servers , inspect , report , test_common , release_notes
6
+
7
+ from contentctl .actions .initialize import Initialize
8
+ from contentctl .objects .config import init , validate , build , new , deploy_acs , test , test_servers , inspect , report , test_common , release_notes
4
9
from contentctl .actions .validate import Validate
5
10
from contentctl .actions .new_content import NewContent
6
11
from contentctl .actions .detection_testing .GitService import GitService
9
14
DirectorOutputDto ,
10
15
Build ,
11
16
)
12
-
13
17
from contentctl .actions .test import Test
14
18
from contentctl .actions .test import TestInputDto
15
19
from contentctl .actions .reporting import ReportingInputDto , Reporting
16
20
from contentctl .actions .inspect import Inspect
17
- from contentctl .actions .acs_deploy import Deploy
18
- import sys
19
- import warnings
20
- import pathlib
21
21
from contentctl .input .yml_reader import YmlReader
22
22
from contentctl .actions .release_notes import ReleaseNotes
23
23
@@ -82,8 +82,8 @@ def build_func(config:build)->DirectorOutputDto:
82
82
def inspect_func (config :inspect )-> str :
83
83
#Make sure that we have built the most recent version of the app
84
84
_ = build_func (config )
85
- appinspect_token = Inspect ().execute (config )
86
- return appinspect_token
85
+ inspect_token = Inspect ().execute (config )
86
+ return inspect_token
87
87
88
88
89
89
def release_notes_func (config :release_notes )-> None :
@@ -95,14 +95,8 @@ def new_func(config:new):
95
95
96
96
97
97
def deploy_acs_func (config :deploy_acs ):
98
- appinspect_token = inspect_func (config )
99
- Deploy ().execute (config , appinspect_token )
100
-
101
-
102
-
103
- def deploy_rest_func (config :deploy_rest ):
104
- raise Exception ("deploy rest not yet implemented" )
105
-
98
+ #This is a bit challenging to get to work with the default values.
99
+ raise Exception ("deploy acs not yet implemented" )
106
100
107
101
def test_common_func (config :test_common ):
108
102
director_output_dto = build_func (config )
@@ -178,15 +172,14 @@ def main():
178
172
"test" :test .model_validate (config_obj ),
179
173
"test_servers" :test_servers .model_construct (** t .__dict__ ),
180
174
"release_notes" : release_notes .model_construct (** config_obj ),
181
- "deploy_acs" : deploy_acs .model_construct (** config_obj ),
182
- #"deploy_rest":deploy_rest()
175
+ "deploy_acs" : deploy_acs .model_construct (** t .__dict__ )
183
176
}
184
177
)
185
178
186
179
187
180
188
181
189
-
182
+ config = None
190
183
try :
191
184
# Since some model(s) were constructed and not model_validated, we have to catch
192
185
# warnings again when creating the cli
@@ -212,8 +205,6 @@ def main():
212
205
elif type (config ) == deploy_acs :
213
206
updated_config = deploy_acs .model_validate (config )
214
207
deploy_acs_func (updated_config )
215
- elif type (config ) == deploy_rest :
216
- deploy_rest_func (config )
217
208
elif type (config ) == test or type (config ) == test_servers :
218
209
if type (config ) == test :
219
210
#construct the container Infrastructure objects
@@ -223,9 +214,18 @@ def main():
223
214
else :
224
215
raise Exception (f"Unknown command line type '{ type (config ).__name__ } '" )
225
216
except Exception as e :
226
- import traceback
227
- traceback .print_exc ()
228
- traceback .print_stack ()
229
- #print(e)
217
+ if config is None :
218
+ print ("There was a serious issue where the config file could not be created.\n "
219
+ "The entire stack trace is provided below (please include it if filing a bug report).\n " )
220
+ traceback .print_exc ()
221
+ elif config .verbose :
222
+ print ("Verbose error logging is ENABLED.\n "
223
+ "The entire stack trace has been provided below (please include it if filing a bug report):\n " )
224
+ traceback .print_exc ()
225
+ else :
226
+ print ("Verbose error logging is DISABLED.\n "
227
+ "Please use the --verbose command line argument if you need more context for your error or file a bug report." )
228
+ print (e )
229
+
230
230
sys .exit (1 )
231
231
0 commit comments