# Only available with vmware or msftocs
- port = get_optional_param(request.POST, 'port')
+ port = get_optional_param(
+ request.POST, 'port', validator=validators.Int(min=1, max=65535))
if port is not None and chassis_type not in ('msftocs', 'vmware'):
return HttpResponseBadRequest( "port is unavailable with the %s chassis type" %
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