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

[build] - Create system eeprom file #5164

Closed
wants to merge 1 commit into from
Closed

[build] - Create system eeprom file #5164

wants to merge 1 commit into from

Conversation

GarrickHe
Copy link
Contributor

  • Create the system eeprom JSON file that is used in the sonic-mgmt-framework
    KLISH CLI.

Signed-off-by: Garrick He garrick_he@dell.com

- Why I did it
When you enter the sonic-mgmt-framework CLI with the command:

sonic-cli

and execute: show platform syseeprom

You will get an error. This is due to the missing syseeprom.json.

- How I did it
Add the command to create the syseeprom.json file if the pmon container is present.

- How to verify it
Created the missing file using the command-line in this diff and verified the system eeprom information appears instead of a error message.

* Create the system eeprom JSON file that is used in the sonic-mgmt-framework
  KLISH CLI.

Signed-off-by: Garrick He <garrick_he@dell.com>
@jleveque
Copy link
Contributor

Is it possible for the sonic-mgmt-framework to read the system EEPROM data from State DB instead of this file?

@jeff-yin
Copy link
Collaborator

@jleveque It is possible, but this PR is to get the command to work WRT the current state of sonic-mgmt-framework.

A set of PRs can be raised against sonic-mgmt-framework and this repo to change over to write/read the system EEPROM data to/from STATE_DB in the next phase/release.

@jeff-yin
Copy link
Collaborator

Retest mellanox please

@jleveque
Copy link
Contributor

@jeff-yin:

It is possible, but this PR is to get the command to work WRT the current state of sonic-mgmt-framework.

A set of PRs can be raised against sonic-mgmt-framework and this repo to change over to write/read the system EEPROM data to/from STATE_DB in the next phase/release.

This PR feels like it is creating a redundant data file. Also, I don't see where this /var/platform/syseeprom file is referenced in sonic-mgmt-framework. Could you please help me understand why this is necessary?

@jeff-yin
Copy link
Collaborator

jeff-yin commented Aug 27, 2020

@jleveque

I don't see where this /var/platform/syseeprom file is referenced in sonic-mgmt-framework. Could you please help me understand why this is necessary?

TL;DR: It turns out this PR is needed exclusively for the 201911 branch and not master at all.

The reason this PR was initially raised was because of this error seen against the 201911 build:

Aug  3 19:48:30.357952 sonic INFO mgmt-framework#supervisord: rest-server I0803 19:48:30.356219      17 pfm_app.go:347] Preparing json for system eeprom
Aug  3 19:48:30.358018 sonic INFO mgmt-framework#supervisord: rest-server I0803 19:48:30.356344      17 pfm_app.go:206] getSysEepromFromFile Enter
Aug  3 19:48:30.358114 sonic INFO mgmt-framework#supervisord: rest-server I0803 19:48:30.356384      17 pfm_app.go:209] syseeprom.json open failed

This is because the 201911 branch of sonic-buildimage tracks only up to this point in sonic-mgmt-framework:
https://github.com/Azure/sonic-mgmt-framework/commits/f789b295f4c775ac303b4370d9380ebba8ac6272
Notice that the code that references the syseeprom.json file is still present there.

Later on, in master, pfm_app.go has been moved to sonic-mgmt-common and the code has been updated to read from State_DB. If the 201911 branch will not advance its src/sonic-mgmt-framework submodule any further, then this commit is needed for sonic-buildimage in order for the show platform command to work.

Do you want us to open a new PR directly against the 201911 branch instead, or can this PR be edited/re-targeted?

@jleveque
Copy link
Contributor

@jeff-yin: Thanks for the detailed explanation. Unfortunately, GitHub doesn't offer a way to retarget a PR to a different branch. Please close this PR and open a new PR against the 201911 branch.

@GarrickHe
Copy link
Contributor Author

Closing this PR and opening a new one to a different branch.

#5285

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.

3 participants