Use head instead of tail 51/17551/1
authorDimitri Mazmanov <dimitri.mazmanov@ericsson.com>
Tue, 26 Jul 2016 10:07:27 +0000 (12:07 +0200)
committerDimitri Mazmanov <dimitri.mazmanov@ericsson.com>
Tue, 26 Jul 2016 10:07:27 +0000 (12:07 +0200)
When retreiving an environment id use head to get the first available
environment

Signed-off-by: Dimitri Mazmanov <dimitri.mazmanov@ericsson.com>
utils/fetch_os_creds.sh

index 34c81af..65c8af3 100755 (executable)
@@ -81,7 +81,7 @@ if [ "$installer_type" == "fuel" ]; then
     verify_connectivity $installer_ip
 
     env=$(sshpass -p r00tme ssh 2>/dev/null $ssh_options root@${installer_ip} \
-        'fuel env'|grep operational|tail -1|awk '{print $1}') &> /dev/null
+        'fuel env'|grep operational|head -1|awk '{print $1}') &> /dev/null
     if [ -z $env ]; then
         error "No operational environment detected in Fuel"
     fi