<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11056</bug_id>
          
          <creation_ts>2017-02-15 09:34:33 +0000</creation_ts>
          <short_desc>yocto-autobuilder-setup fails on openSUSE clean install</short_desc>
          <delta_ts>2017-03-13 21:24:09 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>Infrastructure</classification>
          <product>AutoBuilder</product>
          <component>autobuilder</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Olev Kartau">olev.kartau</reporter>
          <assigned_to name="Joshua Lock">joshuagloe</assigned_to>
          <cc>infras.ab.watcher</cc>
    
    <cc>Infras.watcher</cc>
    
    <cc>pidge</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70711</commentid>
    <comment_count>0</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-02-15 09:34:33 +0000</bug_when>
    <thetext>Trying to set up autobuilder on a clean install of 
openSUSE 42.2 server profile fails:

$ source yocto-autobuilder-setup 
hostname: invalid option -- &apos;I&apos;

That&apos;s because on openSUSE, hostname command is provided by
&apos;net-tools&apos; package (version 1.60 in current case)
and supports -i option to read IP addresses of host.
There is hostname package 3.16 available for openSUSE 42.2 
but in base server profile install it is not installed.

On Fedora-25 (and probably many others), hostname cmd
is installed from &apos;hostname&apos; package and supports
option -I to get IP address.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70715</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-02-15 14:02:40 +0000</bug_when>
    <thetext>Should be trivial to detect whether the call to `hostname -I` fails and try `hostname -i`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70716</commentid>
    <comment_count>2</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-02-15 14:48:42 +0000</bug_when>
    <thetext>Something like:

if ! HOST_ADDR=$(hostname -I); then
    HOST_ADDR=$(hostname -i)
fi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70730</commentid>
    <comment_count>3</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-02-16 08:04:56 +0000</bug_when>
    <thetext>tried this piece, it gets correct value to HOST_ADDR.
Cosmetic issue still remains: invalid option error,
followed by full usage help,
gets printed out on console in the middle of progress trace.

hostname: invalid option -- &apos;I&apos;
Usage: hostname [-v] {hostname|-F file}      set hostname (from file)
       domainname [-v] {nisdomain|-F file}   set NIS domainname (from file)
       hostname [-v] [-d|-f|-s|-a|-i|-y|-n]  display formatted name
       hostname [-v]                         display hostname

       hostname -V|--version|-h|--help       print info and exit

    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y

    -s, --short           short host name
    -a, --alias           alias names
    -i, --ip-address      addresses for the hostname
    -f, --fqdn, --long    long host name (FQDN)
    -d, --domain          DNS domain name
    -y, --yp, --nis       NIS/YP domainname
    -F, --file            read hostname or NIS domainname from given file

   This command can read or set the hostname or the NIS domainname. You can
   also read the DNS domain or the FQDN (fully qualified domain name).
   Unless you are using bind or NIS for host lookups you can change the
   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
   part of the FQDN) in the /etc/hosts file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70763</commentid>
    <comment_count>4</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-02-16 19:08:59 +0000</bug_when>
    <thetext>Of course. I think we&apos;re safe if we redirect stderr to /dev/null, i.e.

if ! HOST_ADDR=$(hostname -I 2&gt; /dev/null); then
    HOST_ADDR=$(hostname -i)
fi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71234</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-03-13 21:24:09 +0000</bug_when>
    <thetext>Landed the proposed change: http://git.yoctoproject.org/clean/cgit.cgi/yocto-autobuilder/commit/?id=6c2dc31749d9dfea660618ef07b1fa06f1a3f7ec</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>