Skip to content
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

Identify SAP diagnostics agent #55

Merged
merged 2 commits into from
Jul 12, 2022
Merged

Identify SAP diagnostics agent #55

merged 2 commits into from
Jul 12, 2022

Conversation

arbulu89
Copy link
Contributor

Cherry-pick missing commit from legacy trento: trento-project/trento@3467e77

I have done some additional changes to adapt the code, as we already were on some conflicts. But the code in essence is the same, so a deep review shouldn't be needed.

After this, some small changes in the web side are needed too.

@arbulu89 arbulu89 added the bug Something isn't working label Jul 12, 2022
}

var instanceType int
for _, instance := range sapControl.Instances {
Copy link
Member

Choose a reason for hiding this comment

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

As I understand here, we loop through the instances but instanceType will be always the last of instances that has sapLocalhost, because we don't break the loop, it's an expected behavior? Maybe if we are only interested in the "first one", or "at least one" of the instances is sapLocalhost we can return into the cases of the switch without looping.

Because if in the instances no one is the sapLocalhost instanceType will be the zero value of int so zero, maybe if this is expected we can initialize the variable not to int but to the appropriate "enum value" like "Application" "Database" etc..

Copy link
Member

Choose a reason for hiding this comment

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

Maybe if the "enum values" are a type alias and not just int, we can refactor the signature of the method in order to return (AliasType, error), so the caller could infer that the value should be one of the aliased values of int defined before

Copy link
Contributor Author

@arbulu89 arbulu89 Jul 12, 2022

Choose a reason for hiding this comment

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

Good idea.
Refactored here: 6af485f
Besides that, I have removed some legacy dead code that I found...
We will have more most probably...

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

LGTM

@arbulu89 arbulu89 merged commit e4972a7 into main Jul 12, 2022
@stefanotorresi stefanotorresi deleted the recover-daa-discovery branch August 17, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

3 participants