Skip to content

Commit

Permalink
Merge pull request #557 from mmasque/fix-binary-exit-code
Browse files Browse the repository at this point in the history
Add a wrapper function to the main entrypoint
  • Loading branch information
mraineri authored Jul 14, 2023
2 parents ac4b615 + c9cf2df commit edda64c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions RedfishServiceValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
import sys

if __name__ == '__main__':
status_code, lastResultsPage, exit_string = main()
sys.exit(status_code)
sys.exit(main())
11 changes: 8 additions & 3 deletions redfish_service_validator/RedfishServiceValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def verbose2(self, msg, *args, **kwargs):
standard_out.setLevel(logging.INFO)
my_logger.addHandler(standard_out)

def main(argslist=None, configfile=None):
def validate(argslist=None, configfile=None):
"""Main command
Args:
Expand Down Expand Up @@ -242,7 +242,12 @@ def main(argslist=None, configfile=None):

return status_code, lastResultsPage, 'Validation done'

def main():
"""
Entry point for the program.
"""
status_code, _, _ = validate()
return status_code

if __name__ == '__main__':
status_code, lastResultsPage, exit_string = main()
sys.exit(status_code)
sys.exit(main())
2 changes: 1 addition & 1 deletion redfish_service_validator/RedfishServiceValidatorGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def run_imp( self ):
# Launch the validator
try:
rsv_config = self.build_config_parser( False )
status_code, last_results_page, exit_string = rsv.main(configfile = rsv_config )
status_code, last_results_page, exit_string = rsv.validate( configfile = rsv_config )
if last_results_page is not None:
webbrowser.open_new( last_results_page )
else:
Expand Down

0 comments on commit edda64c

Please sign in to comment.