Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated cProps call to use the .items() function of the dictionary … #4257

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dan-smalley
Copy link

@dan-smalley dan-smalley commented Oct 13, 2023

…to fix the "too many values to unpack" error when attempting to load a device with cProps defined via the Device API router.

(Submitted support ticket 193756 referencing this pull)

Add device job log output pre-patch:

2023-10-12 21:36:06 ERROR zen.zenjobs.job.createdevicejob: Failed to create device.
Traceback (most recent call last):
  File "/opt/zenoss/Products/ZenModel/ZDeviceLoader.py", line 242, in _run
    for prop, value in cProperties:
ValueError: too many values to unpack
2023-10-12 21:36:06 INFO zen.zenjobs.job.createdevicejob: Event sent  event-class-key=zenjobs-failure summary=ValueError: too many values to unpack
2023-10-12 21:36:06 ERROR zen.zenjobs.job.createdevicejob: Job failed: ValueError('too many values to unpack',)

JSON Payload used to test

{
    "action": "DeviceRouter",
    "method": "addDevice",
    "data": [
        {
            "deviceName": "testDevice",
            "deviceClass": "/Discovered",
            "title": "testDevice",
            "collector": "localhost",
            "productionState": 1000,
            "comments": "Device added via API helper script",
            "model": false,
            "cProperties": {"cCMDBCustomRecId":"supercoolrecid","cOwnedByTeam":"supercoolteam"}
        }
    ],
    "type": "rpc",
    "tid": 3
}

…to fix the "too many items to unpack error" when attempting to load a device with cProps defined via the Device API router.
@webhookbotuser
Copy link
Collaborator

Can one of the admins verify this patch?

2 similar comments
@webhookbotuser
Copy link
Collaborator

Can one of the admins verify this patch?

@webhookbotuser
Copy link
Collaborator

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants