Merge ~ltrager/maas:lp1876217 into maas:master
- Git
- lp:~ltrager/maas
- lp1876217
- Merge into master
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Lee Trager | ||||
Approved revision: | b3108a300dc6e7c0d390a4c0d2d035be6b2d5207 | ||||
Merge reported by: | MAAS Lander | ||||
Merged at revision: | not available | ||||
Proposed branch: | ~ltrager/maas:lp1876217 | ||||
Merge into: | maas:master | ||||
Diff against target: |
300 lines (+118/-35) 5 files modified
src/machine-resources/Makefile (+2/-2) src/machine-resources/src/machine-resources/Gopkg.lock (+12/-15) src/machine-resources/src/machine-resources/main.go (+79/-11) src/metadataserver/builtin_scripts/hooks.py (+5/-1) src/metadataserver/builtin_scripts/tests/test_hooks.py (+20/-6) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Donato (community) | Approve | ||
MAAS Lander | Approve | ||
Review via email: mp+383467@code.launchpad.net |
Commit message
LP: #1876217 - Gather OS information from /etc/os-release or /etc/lsb-release
Description of the change
Alberto Donato (ack) wrote : | # |
I think GetLSBRelease should do the following:
- try to open /etc/lsb-release
- if it fails, get the info from osarch.
- otherwise, parse /etc/lsb-release
- return a struct with just "name" and "version" fields (so the calling code doesn't need to know where does the info come from.
Lee Trager (ltrager) wrote : | # |
In the bug Ian suggested we use a system-files interface for /etc/os-release. Do you see any reason not to do that and dump the modification to main.go?
- a91eff5... by Lee Trager
-
Merge branch 'master' into lp1876217
- 22ebee1... by Lee Trager
-
Try /etc/os-release, fallback on /etc/lsb-release
Lee Trager (ltrager) wrote : | # |
Adam updated me on the meeting with snapd that happened last night. My understanding is snapd will expose /etc/os-release in the future by default. As such I've updated this MP to try /etc/os-release, /usr/lib/
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b lp1876217 lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: SUCCESS
COMMIT: 983f3dd29886787
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b lp1876217 lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: SUCCESS
COMMIT: 22ebee150f37fd2
- 1036759... by Lee Trager
-
Merge branch 'master' into lp1876217
- a52321f... by Lee Trager
-
Don't send OS information if it isn't detectable. If no OS information is
sent don't update the controller's OS.
Lee Trager (ltrager) wrote : | # |
I've updated this to make this highly resilient. Machine resources will only fail to detect OS information when running the Snap on a host OS other then Ubuntu. This will be fixed once snapd passes through /etc/os-release. In the case that detecting OS information fails nothing is sent, MAAS will keep the current OS information.
To answer your question on IRC I'm scanning /etc/os-release and /usr/lib/os-release incase the host OS only provides /usr/lib/
[1] https:/
MAAS Lander (maas-lander) wrote : | # |
UNIT TESTS
-b lp1876217 lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: SUCCESS
COMMIT: a52321f63f9f51d
Alberto Donato (ack) wrote : | # |
A couple of comments inline
- 4d3e828... by Lee Trager
-
Use OSInfo struct
Lee Trager (ltrager) wrote : | # |
Updated to use an OSInfo struct as suggested.
/usr/lib/os-release is actually defined by the freedesktop.org spec[1]. It is suggested both are searched. Fedora and CentOS both provide /usr/lib/
[1] https:/
- b3108a3... by Lee Trager
-
make format
Alberto Donato (ack) wrote : | # |
+1, thanks for the changes
Preview Diff
1 | diff --git a/src/machine-resources/Makefile b/src/machine-resources/Makefile | |||
2 | index a083aec..d28199d 100644 | |||
3 | --- a/src/machine-resources/Makefile | |||
4 | +++ b/src/machine-resources/Makefile | |||
5 | @@ -27,7 +27,7 @@ DEP := cd $(PACKAGE_DIR); dep | |||
6 | 27 | build: $(BINARIES) | 27 | build: $(BINARIES) |
7 | 28 | .PHONY: build | 28 | .PHONY: build |
8 | 29 | 29 | ||
10 | 30 | $(BINARIES): $(PACKAGE_VENDOR_DIR) | 30 | $(BINARIES): $(PACKAGE_VENDOR_DIR) $(PACKAGE_DIR)/main.go |
11 | 31 | GOCACHE=$(GO_CACHE_DIR) GOARCH=$(GOARCH_$(notdir $@)) go build -ldflags '-s -w' -o $@ machine-resources | 31 | GOCACHE=$(GO_CACHE_DIR) GOARCH=$(GOARCH_$(notdir $@)) go build -ldflags '-s -w' -o $@ machine-resources |
12 | 32 | 32 | ||
13 | 33 | $(PACKAGE_VENDOR_DIR) vendor: | 33 | $(PACKAGE_VENDOR_DIR) vendor: |
14 | @@ -41,5 +41,5 @@ clean: | |||
15 | 41 | .PHONY: clean | 41 | .PHONY: clean |
16 | 42 | 42 | ||
17 | 43 | update-deps: | 43 | update-deps: |
19 | 44 | $(DEP) ensure -update github.com/lxc/lxd | 44 | $(DEP) ensure -update |
20 | 45 | .PHONY: update-deps | 45 | .PHONY: update-deps |
21 | diff --git a/src/machine-resources/src/machine-resources/Gopkg.lock b/src/machine-resources/src/machine-resources/Gopkg.lock | |||
22 | index 6c2f652..ce7f9ec 100644 | |||
23 | --- a/src/machine-resources/src/machine-resources/Gopkg.lock | |||
24 | +++ b/src/machine-resources/src/machine-resources/Gopkg.lock | |||
25 | @@ -4,30 +4,26 @@ | |||
26 | 4 | [[projects]] | 4 | [[projects]] |
27 | 5 | name = "github.com/flosch/pongo2" | 5 | name = "github.com/flosch/pongo2" |
28 | 6 | packages = ["."] | 6 | packages = ["."] |
30 | 7 | revision = "bbf5a6c351f4d4e883daa40046a404d7553e0a00" | 7 | revision = "5e81b817a0c48c1c57cdf1a9056cf76bdee02ca9" |
31 | 8 | version = "v3.0" | ||
32 | 8 | 9 | ||
33 | 9 | [[projects]] | 10 | [[projects]] |
34 | 10 | name = "github.com/gorilla/websocket" | 11 | name = "github.com/gorilla/websocket" |
35 | 11 | packages = ["."] | 12 | packages = ["."] |
37 | 12 | revision = "" | 13 | revision = "b65e62901fc1c0d968042419e74789f6af455eb9" |
38 | 13 | version = "v1.4.2" | 14 | version = "v1.4.2" |
39 | 14 | 15 | ||
40 | 15 | [[projects]] | 16 | [[projects]] |
41 | 16 | name = "github.com/jaypipes/pcidb" | 17 | name = "github.com/jaypipes/pcidb" |
42 | 17 | packages = ["."] | 18 | packages = ["."] |
50 | 18 | revision = "49e68a8beb0c155efb2db43bea4b354ec4843ff1" | 19 | revision = "98ef3ee36c69f20650fe7855047ad042338c6983" |
51 | 19 | version = "0.5.0" | 20 | version = "v0.5.0" |
45 | 20 | |||
46 | 21 | [[projects]] | ||
47 | 22 | name = "github.com/juju/errors" | ||
48 | 23 | packages = ["."] | ||
49 | 24 | revision = "3fe23663418fc1d724868c84f21b7519bbac7441" | ||
52 | 25 | 21 | ||
53 | 26 | [[projects]] | 22 | [[projects]] |
54 | 27 | branch = "master" | 23 | branch = "master" |
55 | 28 | name = "github.com/lxc/lxd" | 24 | name = "github.com/lxc/lxd" |
56 | 29 | packages = ["lxd/resources","shared","shared/api","shared/cancel","shared/ioprogress","shared/logger","shared/osarch","shared/units","shared/usbid","shared/version"] | 25 | packages = ["lxd/resources","shared","shared/api","shared/cancel","shared/ioprogress","shared/logger","shared/osarch","shared/units","shared/usbid","shared/version"] |
58 | 30 | revision = "7516f0a2968b025efd1ea5066e78b16d6646b1c8" | 26 | revision = "a101c996de697dda597538ffb95eb4949711f3ec" |
59 | 31 | 27 | ||
60 | 32 | [[projects]] | 28 | [[projects]] |
61 | 33 | name = "github.com/mitchellh/go-homedir" | 29 | name = "github.com/mitchellh/go-homedir" |
62 | @@ -38,16 +34,17 @@ | |||
63 | 38 | [[projects]] | 34 | [[projects]] |
64 | 39 | name = "github.com/pkg/errors" | 35 | name = "github.com/pkg/errors" |
65 | 40 | packages = ["."] | 36 | packages = ["."] |
68 | 41 | revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" | 37 | revision = "614d223910a179a466c1767a985424175c39b465" |
69 | 42 | version = "v0.8.1" | 38 | version = "v0.9.1" |
70 | 43 | 39 | ||
71 | 44 | [[projects]] | 40 | [[projects]] |
72 | 45 | branch = "master" | 41 | branch = "master" |
73 | 46 | name = "golang.org/x/sys" | 42 | name = "golang.org/x/sys" |
76 | 47 | packages = ["unix","windows"] | 43 | packages = ["internal/unsafeheader","unix","windows"] |
77 | 48 | revision = "b09406accb4736d857a32bf9444cd7edae2ffa79" | 44 | revision = "fe76b779f299728f3bd63f77ea2c815504229c3b" |
78 | 49 | 45 | ||
79 | 50 | [[projects]] | 46 | [[projects]] |
80 | 47 | branch = "v2" | ||
81 | 51 | name = "gopkg.in/robfig/cron.v2" | 48 | name = "gopkg.in/robfig/cron.v2" |
82 | 52 | packages = ["."] | 49 | packages = ["."] |
83 | 53 | revision = "be2e0b0deed5a68ffee390b4583a13aff8321535" | 50 | revision = "be2e0b0deed5a68ffee390b4583a13aff8321535" |
84 | @@ -55,6 +52,6 @@ | |||
85 | 55 | [solve-meta] | 52 | [solve-meta] |
86 | 56 | analyzer-name = "dep" | 53 | analyzer-name = "dep" |
87 | 57 | analyzer-version = 1 | 54 | analyzer-version = 1 |
89 | 58 | inputs-digest = "c48e39bda2f6db455f595dad9fbb6171c11d952e37c8b1b1a0f4e85ca1330e8e" | 55 | inputs-digest = "0aa702d9956536c2ac11ab31b412046932bc18980bb395c40153f94d457e48c6" |
90 | 59 | solver-name = "gps-cdcl" | 56 | solver-name = "gps-cdcl" |
91 | 60 | solver-version = 1 | 57 | solver-version = 1 |
92 | diff --git a/src/machine-resources/src/machine-resources/main.go b/src/machine-resources/src/machine-resources/main.go | |||
93 | index be9f16d..7ba5884 100644 | |||
94 | --- a/src/machine-resources/src/machine-resources/main.go | |||
95 | +++ b/src/machine-resources/src/machine-resources/main.go | |||
96 | @@ -4,26 +4,31 @@ | |||
97 | 4 | package main | 4 | package main |
98 | 5 | 5 | ||
99 | 6 | import ( | 6 | import ( |
100 | 7 | "bufio" | ||
101 | 7 | "encoding/json" | 8 | "encoding/json" |
102 | 8 | "fmt" | 9 | "fmt" |
103 | 9 | "os" | 10 | "os" |
104 | 11 | "strings" | ||
105 | 10 | 12 | ||
106 | 11 | "github.com/lxc/lxd/lxd/resources" | 13 | "github.com/lxc/lxd/lxd/resources" |
107 | 12 | "github.com/lxc/lxd/shared" | 14 | "github.com/lxc/lxd/shared" |
108 | 13 | "github.com/lxc/lxd/shared/osarch" | ||
109 | 14 | "github.com/lxc/lxd/shared/version" | 15 | "github.com/lxc/lxd/shared/version" |
110 | 15 | ) | 16 | ) |
111 | 16 | 17 | ||
112 | 18 | type OSInfo struct { | ||
113 | 19 | OSName string `json:"os_name" yaml:"os_name"` | ||
114 | 20 | OSVersion string `json:"os_version" yaml:"os_version"` | ||
115 | 21 | } | ||
116 | 22 | |||
117 | 17 | // Subset of github.com/lxc/lxd/shared/api/server.ServerEnvironment | 23 | // Subset of github.com/lxc/lxd/shared/api/server.ServerEnvironment |
118 | 18 | type ServerEnvironment struct { | 24 | type ServerEnvironment struct { |
119 | 19 | Kernel string `json:"kernel" yaml:"kernel"` | 25 | Kernel string `json:"kernel" yaml:"kernel"` |
120 | 20 | KernelArchitecture string `json:"kernel_architecture" yaml:"kernel_architecture"` | 26 | KernelArchitecture string `json:"kernel_architecture" yaml:"kernel_architecture"` |
121 | 21 | KernelVersion string `json:"kernel_version" yaml:"kernel_version"` | 27 | KernelVersion string `json:"kernel_version" yaml:"kernel_version"` |
127 | 22 | OSName string `json:"os_name" yaml:"os_name"` | 28 | OSInfo |
128 | 23 | OSVersion string `json:"os_version" yaml:"os_version"` | 29 | Server string `json:"server" yaml:"server"` |
129 | 24 | Server string `json:"server" yaml:"server"` | 30 | ServerName string `json:"server_name" yaml:"server_name"` |
130 | 25 | ServerName string `json:"server_name" yaml:"server_name"` | 31 | ServerVersion string `json:"server_version" yaml:"server_version"` |
126 | 26 | ServerVersion string `json:"server_version" yaml:"server_version"` | ||
131 | 27 | } | 32 | } |
132 | 28 | 33 | ||
133 | 29 | // Subset of github.com/lxc/lxd/shared/api/server.HostInfo | 34 | // Subset of github.com/lxc/lxd/shared/api/server.HostInfo |
134 | @@ -45,6 +50,66 @@ func check_error(err error) { | |||
135 | 45 | } | 50 | } |
136 | 46 | } | 51 | } |
137 | 47 | 52 | ||
138 | 53 | func parseKeyValueFile(path string) (map[string]string, error) { | ||
139 | 54 | parsed_file := make(map[string]string) | ||
140 | 55 | file, err := os.Open(path) | ||
141 | 56 | if err != nil { | ||
142 | 57 | return parsed_file, err | ||
143 | 58 | } | ||
144 | 59 | defer file.Close() | ||
145 | 60 | |||
146 | 61 | scanner := bufio.NewScanner(file) | ||
147 | 62 | for scanner.Scan() { | ||
148 | 63 | line := strings.TrimSpace(scanner.Text()) | ||
149 | 64 | if strings.HasPrefix(line, "#") { | ||
150 | 65 | continue | ||
151 | 66 | } | ||
152 | 67 | |||
153 | 68 | tokens := strings.SplitN(line, "=", 2) | ||
154 | 69 | if len(tokens) != 2 { | ||
155 | 70 | continue | ||
156 | 71 | } | ||
157 | 72 | parsed_file[strings.Trim(tokens[0], `'"`)] = strings.Trim(tokens[1], `'"`) | ||
158 | 73 | } | ||
159 | 74 | |||
160 | 75 | return parsed_file, nil | ||
161 | 76 | } | ||
162 | 77 | |||
163 | 78 | func getOSNameVersion() OSInfo { | ||
164 | 79 | // Search both pathes as suggested by | ||
165 | 80 | // https://www.freedesktop.org/software/systemd/man/os-release.html | ||
166 | 81 | for _, path := range []string{"/etc/os-release", "/usr/lib/os-release"} { | ||
167 | 82 | parsed_file, err := parseKeyValueFile(path) | ||
168 | 83 | // LP:1876217 - As of 2.44 snapd only gives confined Snaps | ||
169 | 84 | // access to /etc/lsb-release from the host OS. /etc/os-release | ||
170 | 85 | // currently contains the Ubuntu Core version the Snap is | ||
171 | 86 | // running. Try /etc/os-release first for controllers installed | ||
172 | 87 | // with the Debian packages. At some point in the future snapd | ||
173 | 88 | // may provide the host OS version of /etc/os-release. | ||
174 | 89 | if err == nil && parsed_file["ID"] != "ubuntu-core" { | ||
175 | 90 | return OSInfo{ | ||
176 | 91 | OSName: strings.ToLower(parsed_file["ID"]), | ||
177 | 92 | OSVersion: strings.ToLower(parsed_file["VERSION_ID"]), | ||
178 | 93 | } | ||
179 | 94 | } | ||
180 | 95 | } | ||
181 | 96 | // If /etc/os-release isn't found or only contains the Ubuntu Core | ||
182 | 97 | // version try to get OS information from /etc/lsb-release as this | ||
183 | 98 | // file is passed from the running host OS. Only Ubuntu and Manjaro | ||
184 | 99 | // provide /etc/lsb-release. | ||
185 | 100 | parsed_file, err := parseKeyValueFile("/etc/lsb-release") | ||
186 | 101 | if err == nil { | ||
187 | 102 | return OSInfo{ | ||
188 | 103 | OSName: strings.ToLower(parsed_file["DISTRIB_ID"]), | ||
189 | 104 | OSVersion: strings.ToLower(parsed_file["DISTRIB_RELEASE"]), | ||
190 | 105 | } | ||
191 | 106 | } else { | ||
192 | 107 | // If the OS information isn't detectable don't send anything. | ||
193 | 108 | // MAAS will keep the current OS information. | ||
194 | 109 | return OSInfo{} | ||
195 | 110 | } | ||
196 | 111 | } | ||
197 | 112 | |||
198 | 48 | func GetHostInfo() HostInfo { | 113 | func GetHostInfo() HostInfo { |
199 | 49 | hostname, err := os.Hostname() | 114 | hostname, err := os.Hostname() |
200 | 50 | check_error(err) | 115 | check_error(err) |
201 | @@ -52,14 +117,18 @@ func GetHostInfo() HostInfo { | |||
202 | 52 | uname, err := shared.Uname() | 117 | uname, err := shared.Uname() |
203 | 53 | check_error(err) | 118 | check_error(err) |
204 | 54 | 119 | ||
205 | 55 | osInfo, err := osarch.GetLSBRelease() | ||
206 | 56 | check_error(err) | ||
207 | 57 | |||
208 | 58 | return HostInfo{ | 120 | return HostInfo{ |
209 | 59 | // These are the API extensions machine-resources reproduces. | 121 | // These are the API extensions machine-resources reproduces. |
210 | 60 | APIExtensions: []string{ | 122 | APIExtensions: []string{ |
211 | 61 | "resources", | 123 | "resources", |
212 | 124 | "resources_cpu_socket", | ||
213 | 125 | "resources_gpu", | ||
214 | 126 | "resources_numa", | ||
215 | 62 | "resources_v2", | 127 | "resources_v2", |
216 | 128 | "resources_disk_sata", | ||
217 | 129 | "resources_usb_pci", | ||
218 | 130 | "resources_cpu_threads_numa", | ||
219 | 131 | "resources_cpu_core_die", | ||
220 | 63 | "api_os", | 132 | "api_os", |
221 | 64 | "resources_system", | 133 | "resources_system", |
222 | 65 | }, | 134 | }, |
223 | @@ -71,8 +140,7 @@ func GetHostInfo() HostInfo { | |||
224 | 71 | Kernel: uname.Sysname, | 140 | Kernel: uname.Sysname, |
225 | 72 | KernelArchitecture: uname.Machine, | 141 | KernelArchitecture: uname.Machine, |
226 | 73 | KernelVersion: uname.Release, | 142 | KernelVersion: uname.Release, |
229 | 74 | OSName: osInfo["NAME"], | 143 | OSInfo: getOSNameVersion(), |
228 | 75 | OSVersion: osInfo["VERSION_ID"], | ||
230 | 76 | Server: "maas-machine-resources", | 144 | Server: "maas-machine-resources", |
231 | 77 | ServerName: hostname, | 145 | ServerName: hostname, |
232 | 78 | // Use the imported LXD version as the data comes from | 146 | // Use the imported LXD version as the data comes from |
233 | diff --git a/src/metadataserver/builtin_scripts/hooks.py b/src/metadataserver/builtin_scripts/hooks.py | |||
234 | index d247e5a..056af1a 100644 | |||
235 | --- a/src/metadataserver/builtin_scripts/hooks.py | |||
236 | +++ b/src/metadataserver/builtin_scripts/hooks.py | |||
237 | @@ -662,7 +662,11 @@ def _process_lxd_environment(node, data): | |||
238 | 662 | # on the running machine and LXD Pods are getting this data from LXD | 662 | # on the running machine and LXD Pods are getting this data from LXD |
239 | 663 | # on the running machine. In those cases the information gathered below | 663 | # on the running machine. In those cases the information gathered below |
240 | 664 | # is correct. | 664 | # is correct. |
242 | 665 | if node.is_controller or node.is_pod: | 665 | if ( |
243 | 666 | (node.is_controller or node.is_pod) | ||
244 | 667 | and data.get("os_name") | ||
245 | 668 | and data.get("os_version") | ||
246 | 669 | ): | ||
247 | 666 | # This is how the hostname gets set on controllers and stays in sync on Pods. | 670 | # This is how the hostname gets set on controllers and stays in sync on Pods. |
248 | 667 | node.hostname = data["server_name"] | 671 | node.hostname = data["server_name"] |
249 | 668 | 672 | ||
250 | diff --git a/src/metadataserver/builtin_scripts/tests/test_hooks.py b/src/metadataserver/builtin_scripts/tests/test_hooks.py | |||
251 | index de3424a..5616ee6 100644 | |||
252 | --- a/src/metadataserver/builtin_scripts/tests/test_hooks.py | |||
253 | +++ b/src/metadataserver/builtin_scripts/tests/test_hooks.py | |||
254 | @@ -490,19 +490,19 @@ def make_lxd_host_info( | |||
255 | 490 | "api_os", | 490 | "api_os", |
256 | 491 | "resources_system", | 491 | "resources_system", |
257 | 492 | ] | 492 | ] |
259 | 493 | if not api_version: | 493 | if api_version is None: |
260 | 494 | api_version = "1.0" | 494 | api_version = "1.0" |
262 | 495 | if not kernel_architecture: | 495 | if kernel_architecture is None: |
263 | 496 | kernel_architecture = random.choice( | 496 | kernel_architecture = random.choice( |
264 | 497 | ["i686", "x86_64", "aarch64", "ppc64le", "s390x", "mips", "mips64"] | 497 | ["i686", "x86_64", "aarch64", "ppc64le", "s390x", "mips", "mips64"] |
265 | 498 | ) | 498 | ) |
267 | 499 | if not kernel_version: | 499 | if kernel_version is None: |
268 | 500 | kernel_version = factory.make_name("kernel_version") | 500 | kernel_version = factory.make_name("kernel_version") |
270 | 501 | if not os_name: | 501 | if os_name is None: |
271 | 502 | os_name = "Ubuntu" | 502 | os_name = "Ubuntu" |
273 | 503 | if not os_version: | 503 | if os_version is None: |
274 | 504 | os_version = random.choice(["16.04", "18.04", "20.04"]) | 504 | os_version = random.choice(["16.04", "18.04", "20.04"]) |
276 | 505 | if not server_name: | 505 | if server_name is None: |
277 | 506 | server_name = factory.make_hostname() | 506 | server_name = factory.make_hostname() |
278 | 507 | return { | 507 | return { |
279 | 508 | "api_extensions": api_extensions, | 508 | "api_extensions": api_extensions, |
280 | @@ -1270,6 +1270,20 @@ class TestProcessLXDResults(MAASServerTestCase): | |||
281 | 1270 | self.assertEquals(ubuntu_release["series"], rack.distro_series) | 1270 | self.assertEquals(ubuntu_release["series"], rack.distro_series) |
282 | 1271 | self.assertEquals(server_name, rack.hostname) | 1271 | self.assertEquals(server_name, rack.hostname) |
283 | 1272 | 1272 | ||
284 | 1273 | def test__doesnt_set_os_for_controller_if_blank(self): | ||
285 | 1274 | osystem = factory.make_name("osystem") | ||
286 | 1275 | distro_series = factory.make_name("distro_series") | ||
287 | 1276 | rack = factory.make_RackController( | ||
288 | 1277 | osystem=osystem, distro_series=distro_series | ||
289 | 1278 | ) | ||
290 | 1279 | create_IPADDR_OUTPUT_NAME_script(rack, IP_ADDR_OUTPUT) | ||
291 | 1280 | process_lxd_results( | ||
292 | 1281 | rack, make_lxd_output_json(os_name="", os_version=""), 0 | ||
293 | 1282 | ) | ||
294 | 1283 | rack = reload_object(rack) | ||
295 | 1284 | self.assertEquals(osystem, rack.osystem) | ||
296 | 1285 | self.assertEquals(distro_series, rack.distro_series) | ||
297 | 1286 | |||
298 | 1273 | def test__sets_os_for_pod(self): | 1287 | def test__sets_os_for_pod(self): |
299 | 1274 | pod = factory.make_Pod() | 1288 | pod = factory.make_Pod() |
300 | 1275 | node = factory.make_Node( | 1289 | node = factory.make_Node( |
UNIT TESTS
-b lp1876217 lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas
STATUS: SUCCESS aa7ac4f986052ca 85514a9742
COMMIT: 478ea10101b8e36