Skip to content

Commit

Permalink
Added debug option to other checkers
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Raineri <[email protected]>
  • Loading branch information
mraineri committed Mar 21, 2024
1 parent 2b49d9f commit 73e0e9c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"""

import argparse
import datetime
import logging
import sys
import time

Expand Down Expand Up @@ -60,8 +62,15 @@ def dummy_address_check( address ):
argget.add_argument( "--rhost", "-r", type = str, required = True, help = "The address of the Redfish service" )
argget.add_argument( "--Secure", "-S", type = str, default = "Always", help = "When to use HTTPS (Always, IfSendingCredentials, IfLoginOrAuthenticatedApi, Never)" )
argget.add_argument( "--directory", "-d", type = str, default = None, help = "Output directory for results.json" )
argget.add_argument( "--debug", action = "store_true", help = "Creates debug file showing HTTP traces and exceptions" )
args = argget.parse_args()

if args.debug:
log_file = "manager_ethernet_interface_check-{}.log".format( datetime.datetime.now().strftime( "%Y-%m-%d-%H%M%S" ) )
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
logger = redfish.redfish_logger( log_file, log_format, logging.DEBUG )
logger.info( "manager_ethernet_interface_check Trace" )

# Set up the Redfish object
base_url = "https://" + args.rhost
if args.Secure == "Never":
Expand Down
9 changes: 9 additions & 0 deletions one_time_boot/one_time_boot_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"""

import argparse
import datetime
import logging
import sys
import time

Expand All @@ -31,8 +33,15 @@
argget.add_argument( "--rhost", "-r", type = str, required = True, help = "The address of the Redfish service" )
argget.add_argument( "--Secure", "-S", type = str, default = "Always", help = "When to use HTTPS (Always, IfSendingCredentials, IfLoginOrAuthenticatedApi, Never)" )
argget.add_argument( "--directory", "-d", type = str, default = None, help = "Output directory for results.json" )
argget.add_argument( "--debug", action = "store_true", help = "Creates debug file showing HTTP traces and exceptions" )
args = argget.parse_args()

if args.debug:
log_file = "one_time_boot_check-{}.log".format( datetime.datetime.now().strftime( "%Y-%m-%d-%H%M%S" ) )
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
logger = redfish.redfish_logger( log_file, log_format, logging.DEBUG )
logger.info( "one_time_boot_check Trace" )

# Set up the Redfish object
base_url = "https://" + args.rhost
if args.Secure == "Never":
Expand Down
9 changes: 9 additions & 0 deletions power_control/power_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"""

import argparse
import datetime
import logging
import sys
import time

Expand All @@ -31,8 +33,15 @@
argget.add_argument( "--Secure", "-S", type = str, default = "Always", help = "When to use HTTPS (Always, IfSendingCredentials, IfLoginOrAuthenticatedApi, Never)" )
argget.add_argument( "--directory", "-d", type = str, default = None, help = "Output directory for results.json" )
argget.add_argument( "--timeout", "-t", type = int, default = 10, help = "Length of each timeout after reset" )
argget.add_argument( "--debug", action = "store_true", help = "Creates debug file showing HTTP traces and exceptions" )
args = argget.parse_args()

if args.debug:
log_file = "power_control-{}.log".format( datetime.datetime.now().strftime( "%Y-%m-%d-%H%M%S" ) )
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
logger = redfish.redfish_logger( log_file, log_format, logging.DEBUG )
logger.info( "power_control Trace" )

# Set up the Redfish object
base_url = "https://" + args.rhost
if args.Secure == "Never":
Expand Down
9 changes: 9 additions & 0 deletions power_thermal_info/power_thermal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"""

import argparse
import datetime
import logging
import sys

import redfish
Expand All @@ -30,8 +32,15 @@
argget.add_argument( "--rhost", "-r", type = str, required = True, help = "The address of the Redfish service" )
argget.add_argument( "--Secure", "-S", type = str, default = "Always", help = "When to use HTTPS (Always, IfSendingCredentials, IfLoginOrAuthenticatedApi, Never)" )
argget.add_argument( "--directory", "-d", type = str, default = None, help = "Output directory for results.json" )
argget.add_argument( "--debug", action = "store_true", help = "Creates debug file showing HTTP traces and exceptions" )
args = argget.parse_args()

if args.debug:
log_file = "power_thermal_test-{}.log".format( datetime.datetime.now().strftime( "%Y-%m-%d-%H%M%S" ) )
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
logger = redfish.redfish_logger( log_file, log_format, logging.DEBUG )
logger.info( "power_thermal_test Trace" )

# Set up the Redfish object
base_url = "https://" + args.rhost
if args.Secure == "Never":
Expand Down
9 changes: 9 additions & 0 deletions query_parameters/query_parameters_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"""

import argparse
import datetime
import logging
import sys
import time

Expand Down Expand Up @@ -297,8 +299,15 @@ def only_test( redfish_obj, service_root, results ):
argget.add_argument( "--rhost", "-r", type = str, required = True, help = "The address of the Redfish service" )
argget.add_argument( "--Secure", "-S", type = str, default = "Always", help = "When to use HTTPS (Always, IfSendingCredentials, IfLoginOrAuthenticatedApi, Never)" )
argget.add_argument( "--directory", "-d", type = str, default = None, help = "Output directory for results.json" )
argget.add_argument( "--debug", action = "store_true", help = "Creates debug file showing HTTP traces and exceptions" )
args = argget.parse_args()

if args.debug:
log_file = "query_parameters_check-{}.log".format( datetime.datetime.now().strftime( "%Y-%m-%d-%H%M%S" ) )
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
logger = redfish.redfish_logger( log_file, log_format, logging.DEBUG )
logger.info( "query_parameters_check Trace" )

# Set up the Redfish object
base_url = "https://" + args.rhost
if args.Secure == "Never":
Expand Down

0 comments on commit 73e0e9c

Please sign in to comment.