-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unwanted newline character at end of timestamp #3111
Remove unwanted newline character at end of timestamp #3111
Conversation
Can this be caught by VS test? |
/azpw run Azure.sonic-swss |
/AzurePipelines run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
160c9a4
to
9b68530
Compare
0608aba
to
740340b
Compare
orchagent/portsorch.cpp
Outdated
FieldValueTuple tuple("last_down_time", std::ctime(&now_c)); | ||
char buffer[32]; | ||
// Format: Www Mmm dd hh:mm:ss yyyy | ||
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::localtime(&now_c)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arista-nwolfe can we keep the time in UTC since the syslog event time is in UTC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, note that previously it was already in local time with ctime
9127511
to
1bf7345
Compare
1bf7345
to
f6c3383
Compare
/azpw run Azure.sonic-swss |
/AzurePipelines run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run Azure.sonic-swss |
/AzurePipelines run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
ccb19ba
to
f2d6606
Compare
@prsunny, can you help merge this? |
@arista-nwolfe A backport to 202311 is needed to fix a regression caused by a backport of this PR: #3052 Can you add a |
I don't have label permissions @wenyiz2021 @arlakshm @vmittal-msft would one of you be able to add it. |
hi @arista-nwolfe could you run test with 202311 for the cherrypick? |
@yxieca could you help to cherry pick? |
Tested this on 202311 |
* Remove unwanted newline character at end of timestamp * Cleaner approach to generate timestamp string with no newline character * Use UTC rather than local time in timestamp
Cherry-pick PR to 202311: #3256 |
* Remove unwanted newline character at end of timestamp * Cleaner approach to generate timestamp string with no newline character * Use UTC rather than local time in timestamp
In #3052 2 new fields were added the
PORT_TABLE
inAPPL_DB
:last_down_time
andlast_up_time
.But their value was generated with
std::ctime
which includes a newline character at the end of the character array which causes issues for parsing the output.Output today:
Output after this change: