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

Replace pickle by json #2849

Merged
merged 5 commits into from
May 31, 2023
Merged

Replace pickle by json #2849

merged 5 commits into from
May 31, 2023

Conversation

maipbui
Copy link
Contributor

@maipbui maipbui commented May 25, 2023

This reverts commit 10f31ea.
Revert "Revert "Replace pickle by json (#2636)" (#2746)"

What I did

Revert PR 2746
Add fix default=json_serial in intfstat

How I did it

How to verify it

  	1. dropstat
		a. dropstat -c clear
		b. dropstat -c show
	2. flow_counter_stat
		a. sonic-clear flowcnt-trap
		b. show flowcnt-trap stats
	3. intfstat
		a. intfstat -c
		b. intfstat -c
		c. intfstat -c -t test
		d. intfstat -c -t test
                e. intfstat -p 0
	4. pfcstat
		a. pfcstat -c
		b. pfcstat -s frontend
	5. pg-drop
		a. pg-drop -c clear
		b. pg-drop -c show
	6. portstat
		a. portstat -s frontend
		b. portstat -c
	7. queuestat
		a. queuestat -c
		b. queuestat
		c. queuestat -p Ethernet0
	8. tunnelstat
		a. tunnelstat -c
		b. tunnelstat 

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Signed-off-by: Mai Bui <maibui@microsoft.com>
@maipbui maipbui marked this pull request as ready for review May 30, 2023 20:37
@maipbui maipbui requested a review from qiluo-msft May 30, 2023 20:38
open(self.switch_drop_stats_file, 'wb+'))
json.dump(self.get_counts_table(self.gather_counters(std_port_rx_counters + std_port_tx_counters, DEBUG_COUNTER_PORT_STAT_MAP), COUNTERS_PORT_NAME_MAP),
open(self.port_drop_stats_file, 'w+'))
json.dump(self.get_counts(self.gather_counters([], DEBUG_COUNTER_SWITCH_STAT_MAP), self.get_switch_id()),
Copy link
Contributor

@qiluo-msft qiluo-msft May 30, 2023

Choose a reason for hiding this comment

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

json.dump

Do you need default=json_serial in these 2? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, json_serial is serializer for time objects but dropstat does not have time key.

Signed-off-by: Mai Bui <maibui@microsoft.com>
Signed-off-by: Mai Bui <maibui@microsoft.com>
@qiluo-msft qiluo-msft merged commit dc59dbd into sonic-net:master May 31, 2023
4 checks passed
@maipbui maipbui deleted the pickle branch May 31, 2023 21:20
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Jun 5, 2023
Update sonic-utilities submodule pointer to include the following:
* 5c9b2177 Fix issue: out of range sflow polling interval is accepted and stored in config_db ([sonic-net#2847](sonic-net/sonic-utilities#2847))
* 72ca4848 Add CLI configuration options for teamd retry count feature ([sonic-net#2642](sonic-net/sonic-utilities#2642))
* 359dfc0c [Clock] Implement clock CLI ([sonic-net#2793](sonic-net/sonic-utilities#2793))
* b316fc27 Add transceiver status CLI to show output from TRANSCEIVER_STATUS table ([sonic-net#2772](sonic-net/sonic-utilities#2772))
* dc59dbd2 Replace pickle by json ([sonic-net#2849](sonic-net/sonic-utilities#2849))
* a66f41c4 [show] replace shell=True, replace xml by lxml, replace exit by sys.exit ([sonic-net#2666](sonic-net/sonic-utilities#2666))
* 57500572 [utilities_common] replace shell=True ([sonic-net#2718](sonic-net/sonic-utilities#2718))
* 6e0ee3e7 [CRM][DASH] Extend CRM utility to support DASH resources. ([sonic-net#2800](sonic-net/sonic-utilities#2800))
* b2c29b0b [config] Generate sysinfo in single asic ([sonic-net#2856](sonic-net/sonic-utilities#2856))

Signed-off-by: dprital <drorp@nvidia.com>
StormLiangMS pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jun 5, 2023
…nic-utilities submodule on master (#15193)

Dependency:
sonic-net/sonic-utilities#2718

Why I did it
This PR sonic-net/sonic-utilities#2718 reduce shell=True usage in utilities_common.cli.run_command() function.

Work item tracking
Microsoft ADO (number only): 15022050
How I did it
Replace strings commands using utilities_common.cli.run_command() function to list of strings

due to circular dependency, advance sonic-utilities submodule
72ca4848 (HEAD -> master, upstream/master, upstream/HEAD) Add CLI configuration options for teamd retry count feature (sonic-net/sonic-utilities#2642)
359dfc0c [Clock] Implement clock CLI (sonic-net/sonic-utilities#2793)
b316fc27 Add transceiver status CLI to show output from TRANSCEIVER_STATUS table (sonic-net/sonic-utilities#2772)
dc59dbd2 Replace pickle by json (sonic-net/sonic-utilities#2849)
a66f41c4 [show] replace shell=True, replace xml by lxml, replace exit by sys.exit (sonic-net/sonic-utilities#2666)
57500572 [utilities_common] replace shell=True (sonic-net/sonic-utilities#2718)
6e0ee3e7 [CRM][DASH] Extend CRM utility to support DASH resources. (sonic-net/sonic-utilities#2800)
b2c29b0b [config] Generate sysinfo in single asic (sonic-net/sonic-utilities#2856)
maipbui added a commit that referenced this pull request Jul 31, 2023
Revert test case due to frequent failure in azp introduced in PR #2849
Signed-off-by: Mai Bui <maibui@microsoft.com>
pdhruv-marvell pushed a commit to pdhruv-marvell/sonic-utilities that referenced this pull request Aug 23, 2023
This reverts commit 10f31ea.
Revert "Revert "Replace pickle by json (sonic-net#2636)" (sonic-net#2746)"

#### What I did
Revert PR 2746
Add fix `default=json_serial` in intfstat
#### How I did it

#### How to verify it
```
  	1. dropstat
		a. dropstat -c clear
		b. dropstat -c show
	2. flow_counter_stat
		a. sonic-clear flowcnt-trap
		b. show flowcnt-trap stats
	3. intfstat
		a. intfstat -c
		b. intfstat -c
		c. intfstat -c -t test
		d. intfstat -c -t test
                e. intfstat -p 0
	4. pfcstat
		a. pfcstat -c
		b. pfcstat -s frontend
	5. pg-drop
		a. pg-drop -c clear
		b. pg-drop -c show
	6. portstat
		a. portstat -s frontend
		b. portstat -c
	7. queuestat
		a. queuestat -c
		b. queuestat
		c. queuestat -p Ethernet0
	8. tunnelstat
		a. tunnelstat -c
		b. tunnelstat 
```
pdhruv-marvell pushed a commit to pdhruv-marvell/sonic-utilities that referenced this pull request Aug 23, 2023
Revert test case due to frequent failure in azp introduced in PR sonic-net#2849
Signed-off-by: Mai Bui <maibui@microsoft.com>
dgsudharsan pushed a commit to dgsudharsan/sonic-utilities that referenced this pull request Aug 30, 2023
Revert test case due to frequent failure in azp introduced in PR sonic-net#2849
Signed-off-by: Mai Bui <maibui@microsoft.com>
StormLiangMS pushed a commit that referenced this pull request Sep 3, 2023
Revert test case due to frequent failure in azp introduced in PR #2849
Signed-off-by: Mai Bui <maibui@microsoft.com>
sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
…nic-utilities submodule on master (sonic-net#15193)

Dependency:
sonic-net/sonic-utilities#2718

Why I did it
This PR sonic-net/sonic-utilities#2718 reduce shell=True usage in utilities_common.cli.run_command() function.

Work item tracking
Microsoft ADO (number only): 15022050
How I did it
Replace strings commands using utilities_common.cli.run_command() function to list of strings

due to circular dependency, advance sonic-utilities submodule
72ca4848 (HEAD -> master, upstream/master, upstream/HEAD) Add CLI configuration options for teamd retry count feature (sonic-net/sonic-utilities#2642)
359dfc0c [Clock] Implement clock CLI (sonic-net/sonic-utilities#2793)
b316fc27 Add transceiver status CLI to show output from TRANSCEIVER_STATUS table (sonic-net/sonic-utilities#2772)
dc59dbd2 Replace pickle by json (sonic-net/sonic-utilities#2849)
a66f41c4 [show] replace shell=True, replace xml by lxml, replace exit by sys.exit (sonic-net/sonic-utilities#2666)
57500572 [utilities_common] replace shell=True (sonic-net/sonic-utilities#2718)
6e0ee3e7 [CRM][DASH] Extend CRM utility to support DASH resources. (sonic-net/sonic-utilities#2800)
b2c29b0b [config] Generate sysinfo in single asic (sonic-net/sonic-utilities#2856)
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.

None yet

2 participants