Re: [Libguestfs] [PATCH] Add simple parsing logic for hostname file.

2022-07-21 Thread dzrudy
On Wed, 2022-07-20 at 12:45 +0100, Richard W.M. Jones wrote: > How about this instead? > > It actually changes the behaviour slightly.  Currently a > /etc/hostname > which contains the single character '\n' would return > inspect_get_hostname = "" (which seems wrong).  This is the default >

Re: [Libguestfs] [PATCH] Add simple parsing logic for hostname file.

2022-07-20 Thread Richard W.M. Jones
On Wed, Jul 20, 2022 at 01:36:25PM -0400, dzr...@gmail.com wrote: > On Wed, 2022-07-20 at 12:45 +0100, Richard W.M. Jones wrote: > > How about this instead? > > > > It actually changes the behaviour slightly.  Currently a > > /etc/hostname > > which contains the single character '\n' would return

Re: [Libguestfs] [PATCH] Add simple parsing logic for hostname file.

2022-07-20 Thread Laszlo Ersek
On 07/20/22 13:45, Richard W.M. Jones wrote: > How about this instead? > > It actually changes the behaviour slightly. Currently a /etc/hostname > which contains the single character '\n' would return > inspect_get_hostname = "" (which seems wrong). This is the default > /etc/hostname for

[Libguestfs] [PATCH] Add simple parsing logic for hostname file.

2022-07-20 Thread Dawid Zamirski
There are some linux systems in the wild where the /etc/hostname file does not contain the configured hostname as sole line in that file. This file actually allows for comments [1] starting with "#" and the original logic would extract the comment line instead of the hostname on such systems. This

Re: [Libguestfs] [PATCH] Add simple parsing logic for hostname file.

2022-07-20 Thread Richard W.M. Jones
How about this instead? It actually changes the behaviour slightly. Currently a /etc/hostname which contains the single character '\n' would return inspect_get_hostname = "" (which seems wrong). This is the default /etc/hostname for virt-builder images. I think this is because in the current