Skip to content

analyze/dump: add support for Amazon Linux 2 log lines#346

Merged
OddBloke merged 1 commit into
canonical:masterfrom
OddBloke:analyze
May 6, 2020
Merged

analyze/dump: add support for Amazon Linux 2 log lines#346
OddBloke merged 1 commit into
canonical:masterfrom
OddBloke:analyze

Conversation

@OddBloke
Copy link
Copy Markdown
Collaborator

@OddBloke OddBloke commented May 4, 2020

Amazon Linux 2 is configured with a log format different to the one
shipped by upstream, which means analyze fails to parse any of the log
lines. This updates the code to know how to parse such lines.

LP: #1876323

@OddBloke
Copy link
Copy Markdown
Collaborator Author

OddBloke commented May 4, 2020

These tests are failing because the expected and actual time are exactly 4 hours apart (i.e. the time difference from my system to UTC), so I need to figure out (a) why that isn't happening in other tests, and (b) how to address it.

@OddBloke OddBloke added the wip Work in progress, do not land label May 4, 2020
Amazon Linux 2 is configured with a log format different to the one
shipped by upstream, which means analyze fails to parse any of the log
lines.  This updates the code to know how to parse such lines.

LP: #1876323
@OddBloke OddBloke removed the wip Work in progress, do not land label May 4, 2020
@OddBloke
Copy link
Copy Markdown
Collaborator Author

OddBloke commented May 4, 2020

OK, sorted out the tests, and Travis is looking good, so ready for review again.

Copy link
Copy Markdown
Collaborator

@raharper raharper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. Just one question, should we name and variablize the different separators?

Comment thread cloudinit/analyze/dump.py
# init-local/check-cache: attempting to read from cache [check]

separators = [' - ', ' [CLOUDINIT] ']
separators = [' - ', ' [CLOUDINIT] ', ' cloud-init[']
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth naming these separators ?

SEP1 = ' - '
SEP2 = ' [CLOUDINIT] ',
SEP3 = ' cloud-init['
separators = [SEP1, SEP2, SEP3]

and then the if sep == SEP3

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good thinking, I'll submit that as a follow-up.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted as #350.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants