ScriptResult event emitter doesn't handle place holder

Bug #1840181 reported by Lee Trager on 2019-08-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Lee Trager
2.6
High
Lee Trager

Bug Description

When storage or networking testing is run on a new machine the place holder 'all' is set as the parameter's value. maas-run-remote-scripts detects if the place holder is there and sends a signal to MAAS telling the user to rerun commissioning. The event emitter isn't properly handling the place holder causing testing to get stuck.

Additionally for MAAS 2.7 the event emitter needs to handle interfaces.

2019-08-09 09:27:13 regiond: [info] 20.1.0.2 POST /MAAS/metadata/2012-03-01/ HTTP/1.0 --> 500 INTERNAL_SERVER_ERROR (referrer: -; agent: Python-urllib/3.6)
2019-08-09 09:27:14 maasserver: [error] ################################ Exception: 'str' object has no attribute 'get' ################################
2019-08-09 09:27:14 maasserver: [error] Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 277, in view_atomic_with_post_commit_savepoint
    return view_atomic(*args, **kwargs)
  File "/usr/lib/python3.7/contextlib.py", line 74, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 70, in __call__
    response = upcall(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/views/decorators/vary.py", line 21, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 190, in __call__
    result = self.error_handler(e, request, meth, em_format)
  File "/usr/lib/python3/dist-packages/piston3/resource.py", line 188, in __call__
    result = meth(request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line 310, in dispatch
    return function(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/metadataserver/api.py", line 746, in signal
    target_status = process(node, request, status)
  File "/usr/lib/python3/dist-packages/metadataserver/api.py", line 550, in _process_testing
    node, node.current_testing_script_set, request, status)
  File "/usr/lib/python3/dist-packages/metadataserver/api.py", line 508, in _store_results
    script_result.save(update_fields=['status'])
  File "/usr/lib/python3/dist-packages/metadataserver/models/scriptresult.py", line 383, in save
    return super().save(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/models/cleansave.py", line 214, in save
    return super(CleanSave, self).save(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/models/timestampedmodel.py", line 90, in save
    return super(TimestampedModel, self).save(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 808, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 848, in save_base
    update_fields=update_fields, raw=raw, using=using,
  File "/usr/lib/python3/dist-packages/django/dispatch/dispatcher.py", line 193, in send
    for receiver in self._live_receivers(sender)
  File "/usr/lib/python3/dist-packages/django/dispatch/dispatcher.py", line 193, in <listcomp>
    for receiver in self._live_receivers(sender)
  File "/usr/lib/python3/dist-packages/maasserver/utils/signals.py", line 87, in post_save_callback
    callback(instance, original_values, deleted=False)
  File "/usr/lib/python3/dist-packages/maasserver/models/signals/scriptresult.py", line 34, in emit_script_result_status_transition_event
    'storage', {}).get('value', {}).get('name')
AttributeError: 'str' object has no attribute 'get'

Related branches

Lee Trager (ltrager) on 2019-08-14
Changed in maas:
importance: Undecided → High
milestone: none → 2.7.0alpha1
Lee Trager (ltrager) on 2019-08-16
Changed in maas:
status: New → In Progress
assignee: nobody → Lee Trager (ltrager)
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers