Skip to content

set_item on operational datastore #13

Open
@zfvs

Description

@zfvs

Hi,

I try to modify data in operational datastore and encounter issues. My modifications are applied but getting data fails after this operation. The modified module comes from running datastore.
I execute the following steps:

>>> import sysrepo
>>> 
>>> conn = sysrepo.SysrepoConnection()
>>> op_sess = conn.start_session("operational")
>>> op_sess.get_data('/ccap-docsis40:ccap')
{'ccap': {'vendor-extension-version': {'major-version': 1, 'minor-version': 2}, 'chassis': {'slot': [{'slot-number': 0, 'rf-card': {'line-card-name': '00:01:02:03:04:05', 'admin-state': 'up'}}]}}}
>>> a = "/ccap-docsis40:ccap/vendor-extension-version/major-version"
>>> op_sess.set_item(a, 8)
>>> op_sess.apply_changes()
>>> op_sess.get_data('/ccap-docsis40:ccap')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/sysrepo/session.py", line 699, in get_data
    data = self.get_data_ly(
  File "/usr/local/lib/python3.8/dist-packages/sysrepo/session.py", line 657, in get_data_ly
    check_call(
  File "/usr/local/lib/python3.8/dist-packages/sysrepo/errors.py", line 178, in check_call
    raise SysrepoError.new(msg, ret)
sysrepo.errors.SysrepoLyError: Invalid arguments - no keys for a list (lyd_find_sibling_val())., Invalid arguments - no keys for a list (lyd_find_sibling_val())., Invalid arguments - no keys for a list (lyd_find_sibling_val())., Data for more than one case branch of "line-card-type" choice present., Insert request refers node ((null)) that is going to be auto-deleted.: libyang error

Is modifying items in operational datastore supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions