Skip to content

Commit

Permalink
Revert "[yang] extend ConfigMgmt constructor to pass YANG options (so…
Browse files Browse the repository at this point in the history
…nic-net#2118)"

This reverts commit 2716ff2.
  • Loading branch information
dprital committed Jun 1, 2022
1 parent 85595c8 commit 0b8f222
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions config/config_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ConfigMgmt():
to verify config for the commands which are capable of change in config DB.
'''

def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True, sonicYangOptions=0):
def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True):
'''
Initialise the class, --read the config, --load in data tree.
Expand All @@ -53,7 +53,6 @@ def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True,
self.configdbJsonOut = None
self.source = source
self.allowTablesWithoutYang = allowTablesWithoutYang
self.sonicYangOptions = sonicYangOptions

# logging vars
self.SYSLOG_IDENTIFIER = "ConfigMgmt"
Expand All @@ -68,7 +67,7 @@ def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True,
return

def __init_sonic_yang(self):
self.sy = sonic_yang.SonicYang(YANG_DIR, debug=self.DEBUG, sonic_yang_options=self.sonicYangOptions)
self.sy = sonic_yang.SonicYang(YANG_DIR, debug=self.DEBUG)
# load yang models
self.sy.loadYangModel()
# load jIn from config DB or from config DB json file.
Expand Down Expand Up @@ -281,7 +280,7 @@ def get_module_name(yang_module_str):
"""

# Instantiate new context since parse_module_mem() loads the module into context.
sy = sonic_yang.SonicYang(YANG_DIR, sonic_yang_options=self.sonicYangOptions)
sy = sonic_yang.SonicYang(YANG_DIR)
module = sy.ctx.parse_module_mem(yang_module_str, ly.LYS_IN_YANG)
return module.name()

Expand Down
3 changes: 1 addition & 2 deletions sonic_package_manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
import pkgutil
import tempfile
import yang as ly
from inspect import signature
from typing import Any, Iterable, List, Callable, Dict, Optional

Expand Down Expand Up @@ -1003,7 +1002,7 @@ def get_manager() -> 'PackageManager':
docker_api = DockerApi(docker.from_env(), ProgressManager())
registry_resolver = RegistryResolver()
metadata_resolver = MetadataResolver(docker_api, registry_resolver)
cfg_mgmt = config_mgmt.ConfigMgmt(source=INIT_CFG_JSON, sonicYangOptions=ly.LY_CTX_DISABLE_SEARCHDIR_CWD)
cfg_mgmt = config_mgmt.ConfigMgmt(source=INIT_CFG_JSON)
cli_generator = CliGenerator(log)
feature_registry = FeatureRegistry(SonicDB)
service_creator = ServiceCreator(feature_registry,
Expand Down

0 comments on commit 0b8f222

Please sign in to comment.