chef-cookbooks
chef-cookbooks copied to clipboard
/etc/rpc-release should have a linefeed at the end of the file
Says who?
says me
No other distro release files do... hence why it does not.
/etc/redhat-release doesn't?
/etc/lsb-release /etc/os-release do not.
@claco ummm - it does too.
sure does not on my 12.04 install.
root@breu-ubuntu-havana-ha-neutron-n1:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="12.04.4 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.4 LTS)"
VERSION_ID="12.04"
root@breu-ubuntu-havana-ha-neutron-n1:~#
root@breu-ubuntu-havana-ha-neutron-n1:~# cat /etc/rpc-release
4.2.0root@breu-ubuntu-havana-ha-neutron-n1:~#
opened in stock vi. No line feed.
vi /etc/rpc-release
"/etc/rpc-release" [Incomplete last line] 1 line, 5 characters
here is some more information
root@breu-ubuntu-havana-ha-neutron-n1:/etc# cat rpc-release
4.2.0
root@breu-ubuntu-havana-ha-neutron-n1:/etc# cat rpc-release.old
4.2.0root@breu-ubuntu-havana-ha-neutron-n1:/etc# diff rpc-release rpc-release.old
1c1
< 4.2.0
---
> 4.2.0
\ No newline at end of file
root@breu-ubuntu-havana-ha-neutron-n1:/etc# hex^C
root@breu-ubuntu-havana-ha-neutron-n1:/etc# cat rpc-release
4.2.0
root@breu-ubuntu-havana-ha-neutron-n1:/etc# cat rpc-release.old
4.2.0root@breu-ubuntu-havana-ha-neutron-n1:/etc# diff rpc-release.old rpc-release
1c1
< 4.2.0
\ No newline at end of file
---
> 4.2.0
root@breu-ubuntu-havana-ha-neutron-n1:/etc# hexdump rpc-release
0000000 2e34 2e32 0a30
0000006
root@breu-ubuntu-havana-ha-neutron-n1:/etc# hexdump rpc-release.old
0000000 2e34 2e32 0030
0000005
root@breu-ubuntu-havana-ha-neutron-n1:/etc#
Then it's a problem with https://github.com/rcbops-cookbooks/osops-utils/blob/master/recipes/version.rb#L22
hexdump /etc/os-release
0000000 414e 454d 223d 6255 6e75 7574 0a22 4556
0000010 5352 4f49 3d4e 3122 2e32 3430 332e 4c20
0000020 5354 202c 7250 6365 7369 2065 6150 676e
0000030 6c6f 6e69 0a22 4449 753d 7562 746e 0a75
0000040 4449 4c5f 4b49 3d45 6564 6962 6e61 500a
0000050 4552 5454 5f59 414e 454d 223d 6255 6e75
0000060 7574 7020 6572 6963 6573 2820 3231 302e
0000070 2e34 2033 544c 2953 0a22 4556 5352 4f49
0000080 5f4e 4449 223d 3231 302e 2234 000a
000008d
hexdump /etc/lsb-release
0000000 4944 5453 4952 5f42 4449 553d 7562 746e
0000010 0a75 4944 5453 4952 5f42 4552 454c 5341
0000020 3d45 3231 302e 0a34 4944 5453 4952 5f42
0000030 4f43 4544 414e 454d 703d 6572 6963 6573
0000040 440a 5349 5254 4249 445f 5345 5243 5049
0000050 4954 4e4f 223d 6255 6e75 7574 3120 2e32
0000060 3430 332e 4c20 5354 0a22
000006a
hexdump osops-utils/VERSION
0000000 2e34 2e32 0a32
0000006
We most certainly don't want a newline.
0x0a is your linefeed. That is present in the files you references, but not /etc/rpc-release
edited title so it reflects a linefeed instead of a newline
here is a proposed solution: https://github.com/rackerjoe/rcbops-osops-utils/commit/5e844726286648ba26ce4cd002f45c31be6a0e8d