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

Commit error needs to be reported correctly #190

Closed
ghost opened this issue Jul 21, 2016 · 1 comment
Closed

Commit error needs to be reported correctly #190

ghost opened this issue Jul 21, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jul 21, 2016

For example, for the below commit error:

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>in-use</error-tag>
    <error-severity>error</error-severity>
    <error-message xml:lang="en">'YANG framework' detected the 'fatal' condition 'Datastore locked'</error-message>
  </rpc-error>
</rpc-reply>

The error is reported as:

  File "ydk/tests/parser/Cisco_IOS_XR_parser_cfgTest.py", line 394, in test_parser_submodeexit
    self.crud.create(self.ncc, parser_submodeexit)
  File "/Users///002/ydk-gen/gen-api/python/ydk/services/crud_service.py", line 61, in create
    self._execute_crud_operation_on_provider(provider, entity, 'CREATE', False)
  File "/Users///002/ydk-gen/gen-api/python/ydk/services/crud_service.py", line 166, in _execute_crud_operation_on_provider
    operation
  File "/Users//002/ydk-gen/gen-api/python/ydk/services/service.py", line 37, in execute_payload
    reply = provider.execute(payload, operation)
  File "/Users//002/ydk-gen/gen-api/python/ydk/providers/native_netconf_provider.py", line 90, in execute
    return self.sp_instance.execute_operation(payload, operation)
  File "/Users//002/ydk-gen/gen-api/python/ydk/providers/_provider_plugin.py", line 217, in execute_operation
    return self._handle_rpc_reply(operation, payload, reply_str)
  File "/Users//002/ydk-gen/gen-api/python/ydk/providers/_provider_plugin.py", line 241, in _handle_rpc_reply
    self._handle_rpc_ok(optype, payload, reply_str)
  File "/Users//002/ydk-gen/gen-api/python/ydk/providers/_provider_plugin.py", line 255, in _handle_rpc_ok
    self._handle_commit(payload, reply_str)
  File "/Users//002/ydk-gen/gen-api/python/ydk/providers/_provider_plugin.py", line 276, in _handle_commit
    raise YPYServiceProviderError(error_code=YPYErrorCode.SERVER_COMMIT_ERR, error_msg=reply_str)
YPYServiceProviderError: Server reported an error while committing change.

The below info needs to be added to the above error message:

    error-type: application
    error-tag: in-use
    error-severity: error
    error-message: 'YANG framework' detected the 'fatal' condition 'Datastore locked'
@ghost ghost added the bug label Jul 21, 2016
@ghost ghost added this to the 0.5.0 milestone Jul 21, 2016
@ghost
Copy link
Author

ghost commented Jul 22, 2016

To reproduce, run the sanity test and at the same time, try to do CRUD create operation:

To run sanity test:
python test/test_sanity_types.py

To run CRUD create operation, run this in a python terminal:

from ydk.providers import NetconfServiceProvider
from ydk.services import CRUDService
from ydk.models.ydktest.ydktest_sanity import Runner

crud = CRUDService()
ncc = NetconfServiceProvider(address='127.0.0.1' , username='admin', password='admin', port=12022)
crud.create(ncc,Runner())

@ghost ghost assigned ylil93 Jul 22, 2016
@ghost ghost closed this as completed Aug 3, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant