Merge "Remove nameserver lookup dependency from Cisco ML2 CollectMacConfig."
authorJenkins <jenkins@review.openstack.org>
Wed, 23 Sep 2015 17:29:56 +0000 (17:29 +0000)
committerGerrit Code Review <review@openstack.org>
Wed, 23 Sep 2015 17:29:56 +0000 (17:29 +0000)
puppet/extraconfig/all_nodes/neutron-ml2-cisco-nexus-ucsm.yaml

index 277b074..d08a169 100644 (file)
@@ -163,8 +163,17 @@ resources:
       config: |
         #!/bin/sh
         MACS=$(ifconfig  | grep ether | awk '{print $2}' | tr "\n" " ")
-        HOSTNAME=$(hostname -f)
-        echo "$HOSTNAME $MACS"
+        HOST_FQDN=$(hostname -f)
+        if [ -z "$HOST_FQDN" ]; then
+          HOSTNAME=$(hostname -s)
+          # hardcoding the domain name to avoid DNS lookup dependency
+          # same type of hardcoding appears elsewhere
+          # --ie. controller-puppet.yaml
+          # FIXME_HOSTNAME_DOMAIN_HARDCODE
+          echo "$HOSTNAME.localdomain $MACS"
+        else
+          echo "$HOST_FQDN $MACS"
+        fi
 
   CollectMacDeploymentsController:
     type: OS::Heat::SoftwareDeployments