Skip to content

Fix to improve hostname handling#12064

Merged
yxieca merged 2 commits intosonic-net:masterfrom
devpatha:master
Oct 25, 2022
Merged

Fix to improve hostname handling#12064
yxieca merged 2 commits intosonic-net:masterfrom
devpatha:master

Conversation

@devpatha
Copy link
Contributor

Why I did it

If config_db.json is missing hostname entry, hostname-config.sh ends up deleting existing entry too and hostname changes to default 'localhost'

How I did it

If hostname is not available from config_db.json, do not edit /etc/hostname and exit

How to verify it

with missing hostname entry in config_db.json, /etc/hostname entry is not cleared

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012 for Cisco 8102
  • 202106
  • 202111
  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'
@devpatha devpatha requested a review from lguohan as a code owner September 13, 2022 22:34
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 13, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: devpatha / name: Devesh Pathak (2259365)

@devpatha
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 12064 in repo sonic-net/sonic-buildimage

@balajib-cisco
Copy link

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 12064 in repo sonic-net/sonic-buildimage

@yxieca yxieca merged commit 85e3a81 into sonic-net:master Oct 25, 2022
yxieca pushed a commit that referenced this pull request Oct 25, 2022
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
yxieca pushed a commit that referenced this pull request Oct 25, 2022
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
qiluo-msft pushed a commit that referenced this pull request Oct 26, 2022
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
abdosi pushed a commit that referenced this pull request Jan 30, 2023
* Fix to improve hostname handling
If config_db.json is missing hostname entry, hostname-config.sh ends
up deleting existing entry too and hostname changes to default 'localhost'

* default hostname to 'sonic` if missing in config file
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