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

[image]: remove quote for build_version in /etc/sonic/sonic_version.yml #1512

Merged
merged 1 commit into from
Mar 19, 2018

Conversation

lguohan
Copy link
Collaborator

@lguohan lguohan commented Mar 19, 2018

commit 0965b33 added quote to build_version in /etc/sonic/sonic_version.yml,
e.g., sonic_version : '20170104.10'. scripts to use the $sonic_version need
to remove the quote.

Signed-off-by: Guohan Lu gulv@microsoft.com

- What I did
remove quote for build_version in /etc/sonic/sonic_version.yml in shell script

- How I did it
add eval to remove the quote

- How to verify it

admin@str-s6000-on-4:~$ cat /etc/sonic/sonic_version.yml 
build_version: '20180317.10'
debian_version: '8.10'
kernel_version: '3.16.0-5-amd64'
asic_type: broadcom
commit_id: 'f4ae6a4'
build_date: Sun Mar 18 07:31:47 UTC 2018
build_number: 344
built_by: sonicbld@jenkins-slave-phx-2

admin@str-s6000-on-4:~$ running_sonic_revision=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ")
admin@str-s6000-on-4:~$ echo $running_sonic_revision
'20180317.10'
admin@str-s6000-on-4:~$ eval running_sonic_revision=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ")
admin@str-s6000-on-4:~$ echo $running_sonic_revision
20180317.10

- Description for the changelog

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

commit 0965b33 added quote to build_version in /etc/sonic/sonic_version.yml,
e.g., sonic_version : '20170104.10'. scripts to use the $sonic_version need
to remove the quote.

Signed-off-by: Guohan Lu <gulv@microsoft.com>
Copy link
Contributor

@stcheng stcheng left a comment

Choose a reason for hiding this comment

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

thanks for fixing this!

@lguohan
Copy link
Collaborator Author

lguohan commented Mar 19, 2018

commit 0965b33 also add quote to kernel_version and commit_id, but I do not find them used in script by doing git grep in the buildimage repo. I cannot think of any other places using the kernel_version and commit_id in shell script.

i also tested sh and bash both works.

@lguohan lguohan merged commit 56efb41 into sonic-net:master Mar 19, 2018
@lguohan
Copy link
Collaborator Author

lguohan commented Mar 19, 2018

here was the rc.local log. at the moment, "/host/image-20180317.02/platform/firsttime" does exist.

admin@str-s6000-on-4:~$ sudo /etc/rc.local 
+ [ ! -e /host/machine.conf ]
+ . /host/machine.conf
+ onie_version=3.20.1.5
+ onie_vendor_id=674
+ onie_platform=x86_64-dell_s6000_s1220-r0
+ onie_machine=dell_s6000_s1220
+ onie_machine_rev=0
+ onie_arch=x86_64
+ onie_config_version=1
+ onie_build_date=2016-02-09T17:14-0800
+ onie_partition_type=gpt
+ onie_kernel_version=3.15.10
+ onie_firmware=auto
+ echo install platform dependent packages at the first boot time
install platform dependent packages at the first boot time
+ cat /etc/sonic/sonic_version.yml
+ grep build_version
+ cut -f2 -d 
+ sonic_version='20180317.02'
+ [ -f /host/image-'20180317.02'/platform/firsttime ]
+ exit 0

lguohan added a commit to lguohan/sonic-buildimage that referenced this pull request Mar 23, 2018
…ml (sonic-net#1512)

commit 0965b33 added quote to build_version in /etc/sonic/sonic_version.yml,
e.g., sonic_version : '20170104.10'. scripts to use the $sonic_version need
to remove the quote.

Signed-off-by: Guohan Lu <gulv@microsoft.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.

2 participants