Skip to content

[console] improve picocom launch efficiency#4531

Merged
lizhijianrd merged 1 commit into
sonic-net:masterfrom
hehuang-nokia:dev_cons_feature
Jun 24, 2026
Merged

[console] improve picocom launch efficiency#4531
lizhijianrd merged 1 commit into
sonic-net:masterfrom
hehuang-nokia:dev_cons_feature

Conversation

@hehuang-nokia

Copy link
Copy Markdown
Contributor

replace pexpect calls with direct function call and exec while preserving the original logic

What I did

streamlined the picocom launch process

How I did it

replaced the first pexpect call with a direct function call
wrapped the picocom launch in a bash script
replaced the second pexpect call with execvp

How to verify it

first, launch console app just like before
then, use ps -ef to make sure "connect line" is no longer a standalone process

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

connect line X or just reverse ssh

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@hehuang-nokia
hehuang-nokia marked this pull request as ready for review May 9, 2026 01:55
@Pavan-Nokia

Copy link
Copy Markdown

@Blueve @lizhijianrd Please help review

@Blueve

Blueve commented May 13, 2026

Copy link
Copy Markdown
Contributor

This PR will offload the centralized consutil/picocom implementation to a platform specific script.
May I know what is the motivation of this change and who you measure the improvement of this change?

Blueve
Blueve previously requested changes May 13, 2026

@Blueve Blueve left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hold until clarified the motivation of this change

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Refactor connect/main.py and consutil connect to share a new
console_connect() helper in consutil/lib.py instead of connect
shelling out to consutil connect via pexpect.

Lower-level pexpect-based ConsolePortInfo.connect() is intentionally
unchanged; the os.execvp / bash session script rework is deferred
to a follow-up change.

Signed-off-by: hehuang <henry.1.huang@nokia.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@lizhijianrd

Copy link
Copy Markdown
Contributor

@Blueve the platform specific code are removed.

@lizhijianrd
lizhijianrd dismissed Blueve’s stale review June 24, 2026 11:40

the platform specific code are removed.

@lizhijianrd
lizhijianrd merged commit f148f9b into sonic-net:master Jun 24, 2026
9 checks passed
@mssonicbld

Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202603: Azure/sonic-utilities.msft#376

@hehuang-nokia
hehuang-nokia deleted the dev_cons_feature branch June 24, 2026 13:30
Yogapriya-cisco pushed a commit to vrajeshe/sonic-utilities that referenced this pull request Jul 10, 2026
…sonic-net#4531)

Refactor connect/main.py and consutil connect to share a new
console_connect() helper in consutil/lib.py instead of connect
shelling out to consutil connect via pexpect.

Lower-level pexpect-based ConsolePortInfo.connect() is intentionally
unchanged; the os.execvp / bash session script rework is deferred
to a follow-up change.

Signed-off-by: hehuang <henry.1.huang@nokia.com>
Signed-off-by: Yogapriya Mohankumar <ymohanku@cisco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants