virtual router: edithosts.sh cleanup fails on existing hosts The already deleted same hostname is not deleted from /etc/hosts of vRouter.
vRouter's /etc/hosts format: $ip $host This patch fixes deletion logic below. sed -i /"$host "/d $HOSTS Signed-off-by: Prasanna Santhanam <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/15704cfa Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/15704cfa Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/15704cfa Branch: refs/heads/ui-plugins Commit: 15704cfa6cb26737342cb6293194da129147b976 Parents: 988ccfc Author: Atsushi Midorikawa <[email protected]> Authored: Thu Dec 13 22:59:35 2012 -0800 Committer: Prasanna Santhanam <[email protected]> Committed: Thu Dec 13 23:02:14 2012 -0800 ---------------------------------------------------------------------- patches/systemvm/debian/config/root/edithosts.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/15704cfa/patches/systemvm/debian/config/root/edithosts.sh ---------------------------------------------------------------------- diff --git a/patches/systemvm/debian/config/root/edithosts.sh b/patches/systemvm/debian/config/root/edithosts.sh index 3c6102d..37c75a5 100755 --- a/patches/systemvm/debian/config/root/edithosts.sh +++ b/patches/systemvm/debian/config/root/edithosts.sh @@ -88,7 +88,7 @@ echo "0 $mac $ip $host *" >> $DHCP_LEASES #edit hosts file as well sed -i /"$ip "/d $HOSTS -sed -i /"$host "/d $HOSTS +sed -i /" $host$"/d $HOSTS echo "$ip $host" >> $HOSTS if [ "$dflt" != "" ]
