@@ -53,6 +53,7 @@ def build_and_verify(source_dir=None, yamls=None, ui_validate_io=False,
53
53
if not valid :
54
54
bundle = None
55
55
logger .error ("Bundle failed validation." )
56
+ raise ValueError ("Resulting bundle is invalid, input yaml is improperly defined." )
56
57
else :
57
58
bundle = format_bundle (bundle )
58
59
@@ -80,17 +81,14 @@ def build_verify_and_push(namespace, repository, revision, token,
80
81
81
82
bundle = build_and_verify (source_dir , yamls , validation_output = validation_output )
82
83
83
- if bundle is not None :
84
- with TemporaryDirectory () as temp_dir :
85
- with open ('%s/bundle.yaml' % temp_dir , 'w' ) as outfile :
86
- yaml .dump (bundle , outfile , default_flow_style = False )
87
- outfile .flush ()
84
+ bundle = build_and_verify (source_dir , yamls )
85
+
86
+ with TemporaryDirectory () as temp_dir :
87
+ with open ('%s/bundle.yaml' % temp_dir , 'w' ) as outfile :
88
+ yaml .dump (bundle , outfile , default_flow_style = False )
89
+ outfile .flush ()
88
90
89
- PushCmd ().push (temp_dir , namespace , repository , revision , token )
90
- else :
91
- logger .error ("Bundle is invalid. Will not attempt to push." )
92
- raise ValueError (
93
- "Resulting bundle is invalid, input yaml is improperly defined." )
91
+ PushCmd ().push (temp_dir , namespace , repository , revision , token )
94
92
95
93
96
94
def nest (source_dir , registry_dir ):
0 commit comments