maas-cli raises an error when you pass wrong MAC address filter

Bug #1062598 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Julian Edwards

Bug Description

(logged in the maas-cli)
$ maas-cli maas nodes list mac_address=00:E0:81:DD:D1:ZZ

ERROR 2012-10-05 22:57:49,713 maas.maasserver ################################ Exception: invalid input syntax for type macaddr: "00:E0:81:DD:D1:ZZ"
LINE 1: ...) WHERE "maasserver_macaddress"."mac_address" IN ('00:E0:81:...
                                                             ^
 ################################
ERROR 2012-10-05 22:57:49,715 maas.maasserver Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 204, in __call__
    else: stream = srl.render(request)
  File "/usr/lib/python2.7/dist-packages/piston/emitters.py", line 391, in render
    seria = simplejson.dumps(self.construct(), cls=DateTimeAwareJSONEncoder, ensure_ascii=False, indent=4)
  File "/usr/lib/python2.7/dist-packages/piston/emitters.py", line 300, in construct
    return _any(self.data, self.fields)
  File "/usr/lib/python2.7/dist-packages/piston/emitters.py", line 105, in _any
    ret = _qs(thing, fields)
  File "/usr/lib/python2.7/dist-packages/piston/emitters.py", line 285, in _qs
    return [ _any(v, fields) for v in data ]
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 118, in _result_iter
    self._fill_cache()
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 875, in _fill_cache
    self._result_cache.append(self._iter.next())
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 291, in iterator
    for row in compiler.results_iter():
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 763, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
    return self.cursor.execute(query, args)
DatabaseError: invalid input syntax for type macaddr: "00:E0:81:DD:D1:ZZ"
LINE 1: ...) WHERE "maasserver_macaddress"."mac_address" IN ('00:E0:81:...

Tags: api cli

Related branches

Changed in maas:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Julian Edwards (julian-edwards)
Raphaël Badin (rvb)
Changed in maas:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.