Merge lp:~racb/ubuntu/quantal/maas-enlist/subarch into lp:ubuntu/quantal/maas-enlist

Proposed by Robie Basak on 2012-09-27
Status: Merged
Merge reported by: Andres Rodriguez
Merged at revision: not available
Proposed branch: lp:~racb/ubuntu/quantal/maas-enlist/subarch
Merge into: lp:ubuntu/quantal/maas-enlist
Diff against target: 96 lines (+32/-4)
3 files modified
.pc/applied-patches (+1/-0)
bin/maas-enlist (+25/-4)
debian/changelog (+6/-0)
To merge this branch: bzr merge lp:~racb/ubuntu/quantal/maas-enlist/subarch
Reviewer Review Type Date Requested Status
Ubuntu branches 2012-09-27 Pending
Review via email: mp+126701@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2012-07-12 14:32:03 +0000
3+++ .pc/applied-patches 2012-09-27 14:38:25 +0000
4@@ -0,0 +1,1 @@
5+add-subarch.patch
6
7=== modified file 'bin/maas-enlist'
8--- bin/maas-enlist 2012-08-09 17:36:34 +0000
9+++ bin/maas-enlist 2012-09-27 14:38:25 +0000
10@@ -57,6 +57,20 @@
11 echo "$arch"
12 }
13
14+get_host_subarchitecture() {
15+ local arch=$1
16+ case $arch in
17+ i386|amd64)
18+ # Skip the call to archdetect as that's what
19+ # get_host_architecture does
20+ echo generic
21+ ;;
22+ *)
23+ archdetect | cut -d'/' -f2
24+ ;;
25+ esac
26+}
27+
28 get_server_name() {
29 local servername="$1";
30 _RET=${servername#*://};
31@@ -67,10 +81,11 @@
32 serverurl="${1}"
33 mac="${2}"
34 arch="${3}"
35- hostname="${4}"
36+ subarch="${4}"
37+ hostname="${5}"
38
39 curl \
40- --data "op=new${mac}&hostname=${hostname}&architecture=${arch}&after_commissioning_action=0" \
41+ --data "op=new${mac}&hostname=${hostname}&architecture=${arch}&subarchitecture=${subarch}&after_commissioning_action=0" \
42 "${serverurl}"
43 }
44
45@@ -90,6 +105,7 @@
46 -n | --hostname hostname of the node to register
47 -i | --interface interface address to register (obtains MAC address)
48 -a | --arch architecture of the node to register
49+ --subarch subarchitecture of the node to register
50
51 Example:
52 - ${0##*/} --serverurl 127.0.0.1 --interface eth0
53@@ -100,7 +116,7 @@
54 bad_Usage() { Usage 1>&2; [ $# -eq 0 ] || Error "$@"; exit 1; }
55
56 short_opts="hs:n:i:a:"
57-long_opts="help,serverurl:,hostname:,interface:,arch:"
58+long_opts="help,serverurl:,hostname:,interface:,arch:,subarch:"
59 getopt_out=$(getopt --name "${0##*/}" \
60 --options "${short_opts}" --long "${long_opts}" -- "$@") &&
61 eval set -- "${getopt_out}" ||
62@@ -114,6 +130,7 @@
63 -n|--hostname) hostname=${2}; shift;;
64 -i|--interface) iface=${2}; shift;;
65 -a|--arch) arch=${2}; shift;;
66+ --subarch) subarch=${2}; shift;;
67 --) shift; break;;
68 esac
69 shift;
70@@ -161,7 +178,11 @@
71 arch=$(get_host_architecture)
72 fi
73
74+if [ -z "$subarch" ]; then
75+ subarch=$(get_host_subarchitecture $arch)
76+fi
77+
78 # Obtain the MAC addresses data
79 mac=$(get_mac_address_data "$mac_addrs")
80
81-enlist_node "$protocol://$servername/$api_url" "$mac" "$arch" "$hostname"
82+enlist_node "$protocol://$servername/$api_url" "$mac" "$arch" "$subarch" "$hostname"
83
84=== modified file 'debian/changelog'
85--- debian/changelog 2012-08-09 17:36:34 +0000
86+++ debian/changelog 2012-09-27 14:38:25 +0000
87@@ -1,3 +1,9 @@
88+maas-enlist (0.4+bzr30-0ubuntu2) quantal; urgency=low
89+
90+ * Add subarch support (LP: #1056816)
91+
92+ -- Robie Basak <robie.basak@ubuntu.com> Wed, 26 Sep 2012 18:03:52 +0100
93+
94 maas-enlist (0.4+bzr30-0ubuntu1) quantal; urgency=low
95
96 * bin/maas-enlist: Fix API path URL determination. (LP: #1052989)

Subscribers

People subscribed via source and target branches

to all changes: