Cannot add chassis with port
Bug #1572060 reported by
Gavin Panella
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Unassigned | ||
2.0 |
Won't Fix
|
High
|
Unassigned |
Bug Description
The machines?
specified:
:param port: The port to use when accessing the chassis.
:type port: integer
This port is not converted from a str to an int before being passed to
Node.add_chassis() and then to a remote AddChassis call. However,
AddChassis is defined like so:
class AddChassis(
arguments = [
...
(b"port", amp.Integer(
...
i.e. port must be an int or None.
Related branches
~stefankrupop/maas:fix-1572060
Merged
into
maas:master
- Lee Trager (community): Approve
-
Diff: 81 lines (+42/-3)2 files modifiedsrc/maasserver/api/machines.py (+2/-1)
src/maasserver/api/tests/test_machines.py (+40/-2)
Changed in maas: | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in maas: | |
milestone: | 2.1.0 → 2.1.1 |
Changed in maas: | |
milestone: | 2.1.1 → 2.1.2 |
Changed in maas: | |
milestone: | 2.1.2 → 2.1.3 |
Changed in maas: | |
status: | Triaged → Fix Committed |
no longer affects: | maas/trunk |
Changed in maas: | |
status: | Fix Committed → Fix Released |
milestone: | 2.1.3 → none |
To post a comment you must log in.
The following diff would fix the problem, but test coverage is obviously
needed too:
--- src/maasserver/ api/machines. py 2016-04-14 15:25:36 +0000 api/machines. py 2016-04-19 10:32:03 +0000
"text/plain; charset=%s" % settings. DEFAULT_ CHARSET) )
+++ src/maasserver/
@@ -1374,7 +1374,8 @@
# Only available with vmware or msftocs param(request. POST, 'port') validators. Int(min= 1, max=65535)) Request(
"port is unavailable with the %s chassis type" %
- port = get_optional_
+ port = get_optional_param(
+ request.POST, 'port', validator=
if port is not None and chassis_type not in ('msftocs', 'vmware'):
return HttpResponseBad