changed logic for var_time, improved error message for incorrect monitor_interval input

Signed-off-by: Dipti <dipti.dhond@candelatech.com>
This commit is contained in:
Dipti
2021-02-20 14:35:24 -08:00
parent 35d1443e2b
commit 87210c1cb7
3 changed files with 11 additions and 7 deletions

View File

@@ -645,8 +645,8 @@ class LFCliBase:
dataframe_two = dataframe_two.drop(list(cols_to_remove), axis=1)
#for time elapsed section and endpoint name combo
#
print(dataframe_one)
print(dataframe_two)
#print(dataframe_one)
#print(dataframe_two)
#take those columns and separate those columns from others in DF.

View File

@@ -684,7 +684,7 @@ class Realm(LFCliBase):
else:
duration_time = datetime.timedelta(seconds=dur_time)
else:
raise ValueError("Unknown value for time_string: %s" % time_string)
raise ValueError("Cannot compute time string provided: %s" % time_string)
else:
raise ValueError("time_string must be of type str. Type %s provided" % type(time_string))
return duration_time

View File

@@ -344,7 +344,7 @@ python3 ./test_ipv4_variable_time.py
if not ip_var_test.passes():
print(ip_var_test.get_fail_message())
ip_var_test.exit_fail()
ip_var_test.start(False, False)
try:
layer3connections = ','.join([[*x.keys()][0] for x in ip_var_test.json_get('endp')['endpoint']])
@@ -368,9 +368,13 @@ python3 ./test_ipv4_variable_time.py
print(layer3_cols)
print("Port Manager column names are...")
print(port_mgr_cols)
monitor_interval = Realm.parse_time(args.monitor_interval).total_seconds()
try:
monitor_interval = Realm.parse_time(args.monitor_interval).total_seconds()
except ValueError as error:
print(str(error))
print(ValueError("The time string provided for monitor_interval argument is invalid. Please see supported time stamp increments and inputs for monitor_interval in --help. "))
exit(1)
ip_var_test.start(False, False)
ip_var_test.l3cxprofile.monitor(layer3_cols=layer3_cols,
sta_list=station_list,
port_mgr_cols=port_mgr_cols,