You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should be able to edit all information on a given device.
Current Behavior
happi will throw key error if the field is not in ._info_attrs, though this will also fail if the enforce checks are skipped since extraneous information is not set as attributes of the item.
Possible Solution
If a field is not found as an attribute of the item in question (attributes generated from info_attrs), look to the extraneous dictionary and edit them there
Steps to Reproduce (for bugs)
(pcds-5.4.1)roberttk@psbuild-rhel7-01:~/devrepos/happi(master -)$ happi edit at2l0 creation='poop'
Traceback (most recent call last):
File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.4.1/bin/happi", line 10, in<module>sys.exit(main())
File "/cds/home/r/roberttk/devrepos/happi/happi/cli.py", line 389, in main
happi_cli()
File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.4.1/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.4.1/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.4.1/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.4.1/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.4.1/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.4.1/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
returnf(get_current_context(), *args, **kwargs)
File "/cds/home/r/roberttk/devrepos/happi/happi/cli.py", line 265, in edit
if device._info_attrs[field].enforce in (dict, list):
KeyError: 'creation'
Context
In building tests for another PR, I found I could not edit data on a field that is not in info_attrs
Your Environment
pcds-5.4.1
The text was updated successfully, but these errors were encountered:
Expected Behavior
We should be able to edit all information on a given device.
Current Behavior
happi will throw key error if the field is not in
._info_attrs
, though this will also fail if the enforce checks are skipped sinceextraneous
information is not set as attributes of the item.Possible Solution
If a field is not found as an attribute of the item in question (attributes generated from info_attrs), look to the extraneous dictionary and edit them there
Steps to Reproduce (for bugs)
Context
In building tests for another PR, I found I could not edit data on a field that is not in info_attrs
Your Environment
pcds-5.4.1
The text was updated successfully, but these errors were encountered: