Replace datetime with string for command execution time
@@ -4,7 +4,6 @@ __copyright__ = 'Copyright (C) 2019, Nokia'
__email__ = 'mateusz.m.szczurek@nokia.com'
import re
-import datetime
from moler.cmd.unix.genericunix import GenericUnixCommand
from moler.exceptions import ParsingDone
@@ -82,7 +81,7 @@ class W(GenericUnixCommand):
"""
if self._regex_helper.search_compiled(W._re_general_info, line):
self.current_ret['GENERAL_INFO'].update({
- 'time': datetime.datetime.strptime(self._regex_helper.group("TIME"), '%H:%M:%S').time(),
+ 'time': self._regex_helper.group("TIME"),
'uptime': self._regex_helper.group("UPTIME"),
'user_number': self._regex_helper.group("USER_NUMBER"),
'load_average': self._regex_helper.group("L_AVERAGE")
@@ -150,7 +149,7 @@ host:~ # """
COMMAND_RESULT_parse_general_case = {
'GENERAL_INFO': {'load_average': '0.50, 0.33, 0.14',
- 'time': datetime.time(14, 40, 19),
+ 'time': '14:40:19',
'uptime': '7:12',
'user_number': '5'},
'RESULT': [{'FROM': ':0',
@@ -185,7 +184,7 @@ host:~ # """
COMMAND_RESULT_s_option = {
'GENERAL_INFO': {'load_average': '0.22, 0.33, 0.32',
- 'time': datetime.time(10, 22, 30),
+ 'time': '10:22:30',
'uptime': '3:09',
'user_number': '3'},
'RESULT': [{'FROM': ':0',
@@ -227,7 +226,7 @@ host:~ # """
COMMAND_RESULT_h_option_solo = {
'GENERAL_INFO': {'load_average': '0.50, 0.33, 0.14',
- 'time': datetime.time(14, 40, 19),
+ 'time': '14:40:19',
'uptime': '7:12',
'user_number': '5'},
'RESULT': [{'FROM': ':0',
@@ -253,7 +252,7 @@ host:~ # """
COMMAND_RESULT_h_option_middle = {
'GENERAL_INFO': {'load_average': '0.50, 0.33, 0.14',
- 'time': datetime.time(14, 40, 19),
+ 'time': '14:40:19',
'uptime': '7:12',
'user_number': '5'},
'RESULT': [{'FROM': ':0',
