~rodsmith/maas-cert-server/fix-deployment-failures

« back to all changes in this revision

Viewing changes to usr/sbin/maniacs-setup

  • Committer: Jeff Lane
  • Author(s): Rod Smith
  • Date: 2015-10-21 21:00:51 UTC
  • mfrom: (34.1.1 fix-uuid-auth)
  • Revision ID: jeff_lane-20151021210051-a8enwuzr0q5jt1k1
Moved cluster UUID extraction code to after when 'admin' account is created. The original fix in https://code.launchpad.net/~rodsmith/maas-cert-server/fix-setup-uuid/+merge/274745 introduced a new bug (bug #1507024), which I missed because my original tests were done on systems on which the "admin" account had already been created. This branch moves the code to extract the UUID to a point after which the "admin" account is created.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
        echo "Missing /etc/maas-cert-server/config; exiting!"
99
99
        exit 1
100
100
    fi
101
 
    CLUSTER_UUID=`maas admin node-groups list | grep uuid | cut -d \" -f 4`
102
 
    if [ $CLUSTER_UUID == "" ] || [ $CLUSTER_UUID == "master" ] ; then
103
 
       echo "Unable to determine cluster UUID! Please review your MAAS configuration."
104
 
       echo "Exiting!"
105
 
       exit 1
106
 
    fi
107
101
}
108
102
 
109
103
 
231
225
    echo "* Setting up the $DEFAULT_USER MAAS account using the supplied password"
232
226
    maas-region-admin createadmin --username $DEFAULT_USER --email maas-admin@example.com --password="$password1" 2>/dev/null || true
233
227
    login_maas_admin
 
228
    # Now that the admin user is created, we can extract the cluster UUID....
 
229
    CLUSTER_UUID=`maas admin node-groups list | grep uuid | cut -d \" -f 4`
 
230
    if [ $CLUSTER_UUID == "" ] || [ $CLUSTER_UUID == "master" ] ; then
 
231
       echo "Unable to determine cluster UUID! Please review your MAAS configuration."
 
232
       echo "Exiting!"
 
233
       exit 1
 
234
    fi
234
235
}
235
236
 
236
237