@@ -311,7 +311,9 @@ def check_exists_tag_local(tag_value=None):
311
311
)
312
312
313
313
cmd = "git tag"
314
- return_code , stdout , stderr = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
314
+ return_code , stdout , _ = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
315
+ if return_code > 0 :
316
+ raise OSError ()
315
317
316
318
for line in stdout .splitlines ():
317
319
if tag_value .strip () == line .strip ():
@@ -326,7 +328,9 @@ def git_root_directory():
326
328
return a string with the path name of the git root directory.
327
329
"""
328
330
cmd = "git rev-parse --show-toplevel"
329
- return_code , stdout , stderr = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
331
+ return_code , stdout , _ = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
332
+ if return_code > 0 :
333
+ raise OSError ()
330
334
retval = None
331
335
for line in stdout .splitlines ():
332
336
if line .strip () != "" :
@@ -545,14 +549,21 @@ def main(args):
545
549
546
550
## FIXME git merge command below does NOT merge anything...
547
551
cmd = f"git merge { original_branch_name } -m '{ args .message } '"
548
- return_code , stdout , stderr = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
552
+ return_code , _ , _ = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
553
+ if return_code > 0 :
554
+ raise OSError ()
555
+
549
556
550
557
cmd = "git push origin main"
551
- return_code , stdout , stderr = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
558
+ return_code , _ , _ = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
559
+ if return_code > 0 :
560
+ raise OSError ()
552
561
553
562
if args .tag is True :
554
563
cmd = "git push origin main --tags"
555
- return_code , stdout , stderr = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
564
+ return_code , _ , _ = ciscoconfparse .ccp_util .run_this_posix_command (cmd )
565
+ if return_code > 0 :
566
+ raise OSError ()
556
567
557
568
if original_branch_name != "main" :
558
569
args .branch = original_branch_name
0 commit comments