~veebers/juju-ci-tools/model_migration_controller_cleanup

« back to all changes in this revision

Viewing changes to maas/reset-fabrics.bash

  • Committer: Curtis Hovey
  • Date: 2017-01-05 14:55:38 UTC
  • Revision ID: curtis@canonical.com-20170105145538-hj85ym1i95wgwdq1
Release machines before reseting interfaces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# Find the vlan id of the default fabric.
22
22
VLAN=$(
23
23
    maas $ENV fabric read 0 |
24
 
    sed -r '/vlans/,/}/!d; /"id"/!d; s,[^0-9],,g')
 
24
    sed -r '/vlans/,/}/!d; /"id"/!d; s,[^0-9],,g' |
 
25
    head -1)
25
26
# Learn the misconfigured interfaces by attempting to delete
26
27
# the unwanted fabric.
27
28
INTERFACES=$(
35
36
    system_id=$(
36
37
        echo "$ALL_SYSTEM_HOSTS" |
37
38
        grep $machine@ | cut -d @ -f2)
 
39
    maas $ENV machine release $system_id
 
40
    sleep 5
38
41
    maas $ENV interface update $system_id $iface fabric=0 vlan=$VLAN
39
42
done
40
43
# Delete the unwanted fabric.