title: Airflow 1.10 Config Core hostname_callable - How To Set?
body: <p>I'm regards to my <a href="https://stackoverflow.com/questions/51898933/airflow-ec2-instance-socket-getfqdn-bug">previous Stackoverflow post here</a> I've finally upgraded from Airflow version 1.9 to 1.10 since it's now <a href="https://pypi.org/project/apache-airflow/" rel="noreferrer">released on PyPi</a>. Using <a href="https://github.com/apache/incubator-airflow/blob/master/UPDATING.md" rel="noreferrer">their release guide here</a> I got Airflow 1.10 working. Now I inspected their udpates to 1.10 to see how they addressed <a href="https://github.com/apache/incubator-airflow/pull/2484" rel="noreferrer">the bug discovered in Airflow version 1.9</a> when run on an AWS EC2-Instance. And I found that they replaced all functions that got the servers IP address with a call to this new Airflow class's function <code>get_hostname</code> <a href="https://github.com/apache/incubator-airflow/blob/master/airflow/utils/net.py" rel="noreferrer">https://github.com/apache/incubator-airflow/blob/master/airflow/utils/net.py</a>. Now, inside that small function you see the comment that says, </p>
  
  <blockquote>
    <p>Fetch the hostname using the callable from the config or using
    socket.getfqdn as a fallback.</p>
  </blockquote>
  
  <p>So then after that comment you see the code,</p>
  
  <pre><code>callable_path = conf.get('core', 'hostname_callable')
  </code></pre>
  
  <p>Which tells us in the <code>airflow.cfg</code> under the section <code>[core]</code> there is a new key value field called <code>hostname_callable</code> which now lets us set how we want to fetch the servers IP address. So their fix for the bug seen in Airflow version 1.9 is to just let us choose how to fetch the IP address if we need to change it. Their default value for this new configuration field is seen here <a href="https://github.com/apache/incubator-airflow/blob/master/airflow/config_templates/default_airflow.cfg" rel="noreferrer">https://github.com/apache/incubator-airflow/blob/master/airflow/config_templates/default_airflow.cfg</a> under the <code>[core]</code> section. You can see they have it set as,</p>
  
  <pre><code>[core]
  # Hostname by providing a path to a callable, which will resolve the hostname
  hostname_callable = socket:getfqdn
  </code></pre>
  
  <p>So they're using the function call <code>socket:getfqdn</code> that causes the bug to occur when run on an AWS EC2-Instance. I need it to use <code>socket.gethostbyname(socket.gethostname())</code> (<a href="https://stackoverflow.com/questions/51898933/airflow-ec2-instance-socket-getfqdn-bug">again this is mentioned in more detail on my previous post</a>)</p>
  
  <p>So my question is what's the syntax that I need to use in order to get <code>socket.gethostbyname(socket.gethostname())</code> in the configuration style of using colons <code>:</code>. For example the function call <code>socket.getfqdn()</code> is written in the configuration file as <code>socket:getfqdn</code>. So I don't see how I would write that syntax with a nested call. Would I write something like <code>socket:gethostbyname(socket.gethostname())</code>?</p>