Skip to content

Commit

Permalink
Resolved GitHub issue CiscoDevNet#983
Browse files Browse the repository at this point in the history
  • Loading branch information
ygorelik committed Jan 9, 2020
1 parent f1a087c commit 4bee560
Show file tree
Hide file tree
Showing 7 changed files with 936 additions and 14 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ matrix:
# - os: linux
# dist: trusty
# group: edge
- os: osx
osx_image: xcode9.2
language: generic
go: 1.9
- os: osx
env: GNMI=true
osx_image: xcode9.2
language: generic
go: 1.9
# - os: osx
# osx_image: xcode9.2
# language: generic
# go: 1.9
# - os: osx
# env: GNMI=true
# osx_image: xcode9.2
# language: generic
# go: 1.9
# - env: DOCKER=true OS_TYPE=centos OS_VERSION=centos7 PYTHON_VERSION=2.7
# - env: DOCKER=true OS_TYPE=centos OS_VERSION=centos7 PYTHON_VERSION=2.7 GNMI=true
- env: DOCKER=true OS_TYPE=centos OS_VERSION=centos7 PYTHON_VERSION=3.6
- env: DOCKER=true OS_TYPE=centos OS_VERSION=centos7 PYTHON_VERSION=3.6 GNMI=true
# - env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=xenial PYTHON_VERSION=2.7
# - env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=xenial PYTHON_VERSION=2.7 GNMI=true
- env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=xenial PYTHON_VERSION=3.5
- env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=xenial PYTHON_VERSION=3.5 GNMI=true
# - env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=xenial PYTHON_VERSION=3.5
# - env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=xenial PYTHON_VERSION=3.5 GNMI=true
# - env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=bionic PYTHON_VERSION=2.7
# - env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=bionic PYTHON_VERSION=2.7 GNMI=true
- env: DOCKER=true OS_TYPE=ubuntu OS_VERSION=bionic PYTHON_VERSION=3
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
* Enhance generator to indicate how a YANG modules was processed ([#894](https://github.com/CiscoDevNet/ydk-gen/issues/894))
* YDK fails create bundle package when package name contains '.' ([#978](https://github.com/CiscoDevNet/ydk-gen/issues/978))
* python bundle generator must escape 'async' as variable name ([#980](https://github.com/CiscoDevNet/ydk-gen/issues/980))
* YDK fails instantiate some of the generated bundle classes ([#983](https://github.com/CiscoDevNet/ydk-gen/issues/983))

#### Bundle improvements
* Updated cisco-ios-xe bundle to support Cisco IOS XE 16.9.3 due to bug in Python generated code
* Updated cisco-ios-xr bundle to support Cisco IOS XR 6.6.3

#### Documentation improvements
* Bundle profile description is not accurate ([#971](https://github.com/CiscoDevNet/ydk-gen/issues/971))
Expand Down
916 changes: 916 additions & 0 deletions profiles/bundles/cisco-ios-xr_6_6_3.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions sdk/python/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

#### Resolved GitHub issues
* python bundle generator must escape 'async' as variable name ([#980](https://github.com/CiscoDevNet/ydk-gen/issues/980))
* YDK fails instantiate some of the generated bundle classes ([#983](https://github.com/CiscoDevNet/ydk-gen/issues/983))

#### Bundle improvements
* Updated cisco-ios-xe bundle to support Cisco IOS XE 16.9.3 due to bug in Python generated code
* Updated cisco-ios-xr bundle to support Cisco IOS XR 6.6.3


### 2019-10-15 version 0.8.4
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/core/ydk/entity_utils/entity_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def _datanode_to_entity(data_node):
try:
imported_module = importlib.import_module('ydk.models.{}.{}'.format(name, module_name))
entity = getattr(imported_module, class_name)()
except:
raise YModelError("Failed instantiate class '{}' from module '{}'".format(class_name, module_name))
except Exception as err:
raise YModelError("Failed instantiate class '{}' from module '{}': {}".format(class_name, module_name, err))

top_entity = entity.clone_ptr()
get_entity_from_data_node(data_node, top_entity)
Expand Down
2 changes: 1 addition & 1 deletion ydkgen/printer/python/class_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _print_class_trailer(self, clazz):
def _print_class_declaration(self, clazz):
self.ctx.bline()

parents = 'Entity'
parents = '_Entity_'
if clazz.is_identity():
if len(clazz.extends) > 0:
parents = ' ,'.join([sup.qn() for sup in clazz.extends])
Expand Down
2 changes: 2 additions & 0 deletions ydkgen/printer/python/module_printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def _print_static_imports(self):
self.ctx.writeln("import sys")
self.ctx.writeln("from collections import OrderedDict")
self.ctx.bline()
self.ctx.writeln("from ydk.types import Entity as _Entity_")
self.ctx.writeln("from ydk.types import EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64")
self.ctx.writeln(
"from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64")
self.ctx.writeln("from ydk.filters import YFilter")
Expand Down

0 comments on commit 4bee560

Please sign in to comment.