Skip to content

Configure will exception if a property has no initial value is defined #2

@btgoodwin

Description

@btgoodwin

Simple string properties on Components (and Devices) up through REDHAWK 1.10.2 that have no default value result in queryValue() returning None. This causes line model/redhawk.py line 109 to throw an exception. Refactoring to use the TYPE_MAP in ossie.utils prop_helper can solve the problem:

from ossie.utils import prop_helper

...

@background_task
def component_configure(self, domain_name, app_id, comp_id, new_properties):
    dom = self._get_domain(domain_name)
    comp = dom.find_component(app_id, comp_id)

    configure_changes = {}
    for prop in comp._properties:
        if prop.id in new_properties:
            if new_properties[prop.id] != prop.queryValue():
                TYPE = prop_helpers.TYPE_MAP.get(prop.type, [type(prop.queryValue())])
                configure_changes[prop.id] = (TYPE[0])(new_properties[prop.id])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions