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

Managed Object init tries to set unknown properties #177

Closed
mtimm opened this issue Jun 11, 2018 · 2 comments · May be fixed by #178
Closed

Managed Object init tries to set unknown properties #177

mtimm opened this issue Jun 11, 2018 · 2 comments · May be fixed by #178
Labels

Comments

@mtimm
Copy link
Contributor

mtimm commented Jun 11, 2018

From init of the ManagedObject class:

        if kwargs:
            for prop_name, prop_value in imcgenutils.iteritems(kwargs):
                if not imccoreutils.prop_exists(self, prop_name):
                    log.debug("Unknown property %s" % prop_name)
                self.__set_prop(prop_name, prop_value)

If the prop does not exist a log message is printed but the property is still attempted to be set which causes a failure later in __set_prop where prop.access results in an AttributeError:

        if not forced:
            prop = imccoreutils.get_prop_meta(self, name)
            if not imccoreutils.is_writable_prop(self, name):
                if getattr(self, name) is not None or \
                                prop.access != \
                                imccoremeta.MoPropertyMeta.CREATE_ONLY:
                    raise ValueError("%s is not a read-write property." % name)

Here is the traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "imcsdk/mometa/bios/BiosVfPackageCStateLimit.py", line 81, in __init__
    ManagedObject.__init__(self, "BiosVfPackageCStateLimit", parent_mo_or_dn, **kwargs)
  File "imcsdk/imcmo.py", line 99, in __init__
    self.__set_prop(prop_name, prop_value)
  File "imcsdk/imcmo.py", line 186, in __set_prop
    prop.access != \
AttributeError: 'NoneType' object has no attribute 'access'
@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label Oct 28, 2023
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

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

Successfully merging a pull request may close this issue.

1 participant