diff -Nru maas-enlist-0.4/debian/changelog maas-enlist-0.4/debian/changelog --- maas-enlist-0.4/debian/changelog 2012-10-10 05:10:48.000000000 +0000 +++ maas-enlist-0.4/debian/changelog 2012-10-11 14:51:15.000000000 +0000 @@ -1,3 +1,11 @@ +maas-enlist (0.4-0ubuntu1.3) precise-proposed; urgency=low + + [ Scott Moser ] + * debian/patches/04-fix-multiple-mac-enlist.patch: Fix to allow the + enlistment of multiple MAC addresses. (LP: #1065259) + + -- Andres Rodriguez Thu, 11 Oct 2012 10:49:59 -0400 + maas-enlist (0.4-0ubuntu1.2) precise-proposed; urgency=low [ Robbie Basak ] diff -Nru maas-enlist-0.4/debian/patches/04-fix-multiple-mac-enlist.patch maas-enlist-0.4/debian/patches/04-fix-multiple-mac-enlist.patch --- maas-enlist-0.4/debian/patches/04-fix-multiple-mac-enlist.patch 1970-01-01 00:00:00.000000000 +0000 +++ maas-enlist-0.4/debian/patches/04-fix-multiple-mac-enlist.patch 2012-10-10 21:52:27.000000000 +0000 @@ -0,0 +1,59 @@ +Description: Fix multiple MAC address enlistment + This patch fixes enlistment when multple mac addresses + are being detected. Otherwise it will fail to enlist. +Author: Scott Moser +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1065259 + +Index: maas-enlist-0.4/bin/maas-enlist +=================================================================== +--- maas-enlist-0.4.orig/bin/maas-enlist 2012-10-10 17:52:25.300205740 -0400 ++++ maas-enlist-0.4/bin/maas-enlist 2012-10-10 17:52:25.316205740 -0400 +@@ -37,14 +37,15 @@ + echo "$mac" + } + +-get_mac_address_data() { +- input_string="$1" ++get_mac_address_curl_parms() { ++ local args="" input_string="$1" + OIFS=$IFS; IFS=","; set -- $input_string; IFS=$OIFS + for i in "$@"; + do +- mac_address="$mac_address""&mac_addresses=""${i}"; ++ args="${args} --data-urlencode mac_addresses=${i}" ++ #mac_address="$mac_address""&mac_addresses=""${i}"; + done +- echo "$mac_address" ++ echo "${args# }" + } + + get_host_architecture() { +@@ -80,15 +81,18 @@ + power_type="${6}" + power_params="${7}" + ++ local macparms="" ++ macparms=$(get_mac_address_curl_parms "$mac") ++ + curl \ + --data-urlencode "op=new" \ +- --data-urlencode "${mac}" \ + --data-urlencode "hostname=${hostname}" \ + --data-urlencode "architecture=${arch}" \ + --data-urlencode "subarchitecture=${subarch}" \ + --data-urlencode "after_commissioning_action=0" \ + --data-urlencode "power_type=${power_type}" \ + --data-urlencode "power_parameters=${power_params}" \ ++ ${macparms} \ + "${serverurl}"/MAAS/api/1.0/nodes/ + } + +@@ -201,7 +205,4 @@ + esac + fi + +-# Obtain the MAC addresses data +-mac=$(get_mac_address_data "$mac_addrs") +- +-enlist_node "$protocol://$servername" "$mac" "$arch" "$subarch" "$hostname" "$power_type" "$power_parameters" ++enlist_node "$protocol://$servername" "${mac_addrs}" "$arch" "$subarch" "$hostname" "$power_type" "$power_parameters" diff -Nru maas-enlist-0.4/debian/patches/series maas-enlist-0.4/debian/patches/series --- maas-enlist-0.4/debian/patches/series 2012-10-10 04:16:47.000000000 +0000 +++ maas-enlist-0.4/debian/patches/series 2012-10-10 21:44:50.000000000 +0000 @@ -1,3 +1,4 @@ 01-fix-after-commissioning-action.patch 02-add-subarch.patch 03-add-power-parameters.patch +04-fix-multiple-mac-enlist.patch