-
Notifications
You must be signed in to change notification settings - Fork 812
[sonic-package-manager] support sonic-cli-gen and packages with YANG model #1650
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
Merged
Merged
Changes from 220 commits
Commits
Show all changes
223 commits
Select commit
Hold shift + click to select a range
2356869
[sonic-installer] migrate SONiC packages
stepanblyschak ece3845
fix temp dir path for chroot
stepanblyschak 8bc75a7
fix for install of already installed image
stepanblyschak e72f540
move constants to the top
stepanblyschak 1a6d5d9
Merge branch 'master' of github.com:azure/sonic-utilities into sonic-…
stepanblyschak be4f089
[sonic_installer] migrate packages from old docker library
stepanblyschak 2240308
Merge branch 'master' of github.com:azure/sonic-utilities into sonic-…
stepanblyschak 9fd283d
remove unused imports
stepanblyschak 0cbaa3e
fix redefining path
stepanblyschak 1a99797
[sonic-package-manager] add new utility to manage SONiC packages
stepanblyschak a80ecb0
Merge branch 'sonic-packages-migration' into spm
stepanblyschak 06dfd30
add help for some options
stepanblyschak 725210d
add command line reference for sonic-package-manager
stepanblyschak f2ee39f
fix upgrade command missing argument
stepanblyschak 7bf937e
warm-reboot support for sonic packages
stepanblyschak c724569
iteritems -> items
stepanblyschak ac011a3
Merge branch 'spm' into spm_warm
stepanblyschak 3dc793f
fix issue in metadata dict generation
stepanblyschak 4e4a9ea
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak ea14867
fix creator with service name
stepanblyschak faeadcf
default value for component constraint
stepanblyschak cd7d387
Merge branch 'spm' into spm_warm
stepanblyschak 31138d0
fix passing installed_packages
stepanblyschak ae1ce45
Update doc/Command-Reference.md
stepanblyschak 5c045e0
use defaultdict
stepanblyschak a1a97f9
fix internal review comments
stepanblyschak 7a6c8d1
fix internal review comments
stepanblyschak c4b4225
use get_installed_packages_list() function
stepanblyschak f32d038
dont fail uninstall when no package in installed list
stepanblyschak 83f2af6
drop support for monit as monit is getting deprecated
stepanblyschak d31497a
fix manifest representation
stepanblyschak c2eacdf
fix LGTM warning
stepanblyschak 801ff85
Merge branch 'master' into spm
stepanblyschak f5ba246
fix review comments
stepanblyschak 2dee5c6
fix review comments
stepanblyschak 08c9c6d
[sonic_package_manager] add reset command
stepanblyschak 42a2665
Merge branch 'master' into spm
stepanblyschak 8bd4f5e
add yang
stepanblyschak 413b44f
[doc] fix formatting
stepanblyschak 78afedd
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into spm
stepanblyschak f101f1f
install takes a digest or tag as well
stepanblyschak 4d03aa8
resolve review comments
stepanblyschak 180eae3
remove config when uninstalling
stepanblyschak 3b98489
fix lgtm error
stepanblyschak 3280b5b
Update doc/Command-Reference.md
stepanblyschak 21ae66b
Update doc/Command-Reference.md
stepanblyschak 5548976
Update doc/Command-Reference.md
stepanblyschak 5a2675d
Update doc/Command-Reference.md
stepanblyschak 68f90f5
Update doc/Command-Reference.md
stepanblyschak e7f1c59
Update doc/Command-Reference.md
stepanblyschak ae5bad9
Update doc/Command-Reference.md
stepanblyschak 909079a
Update doc/Command-Reference.md
stepanblyschak a394b27
Update doc/Command-Reference.md
stepanblyschak 9653c61
Update doc/Command-Reference.md
stepanblyschak 0e96ddb
Update doc/Command-Reference.md
stepanblyschak 9090a47
Update doc/Command-Reference.md
stepanblyschak b2eeb59
Update doc/Command-Reference.md
stepanblyschak e765d5d
review comments
stepanblyschak 24fb439
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into spm
stepanblyschak 5991557
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak fd46c34
fix upgrade rollback
stepanblyschak c8a3cbf
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak 1348a6e
remove trailing spaces
stepanblyschak f4449c1
remove trailing spaces
stepanblyschak 8fd0084
remove trailing spaces
stepanblyschak b065eaf
yang
stepanblyschak 86bf53f
address review comments
stepanblyschak 3f9c317
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak 84e0b58
yang
stepanblyschak 1ace0e1
fix command line options for install/upgrade
stepanblyschak 4578e87
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak 5133947
yang
stepanblyschak 0fc6463
fix bug when have components constraints
stepanblyschak b23ac17
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak 6feda36
fix bug when have components constraints
stepanblyschak e0f9699
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak a2f7649
Merge branch 'master' into spm
stepanblyschak 548896a
Worked version
vadymhlushko-mlnx 3350f27
added stub for function to determine static or dynamic YANG
vadymhlushko-mlnx 1d1643a
_find_index_of_yang_model()
vadymhlushko-mlnx cd31f0d
added function to init list's for module, top, tables
vadymhlushko-mlnx 81b803d
Added func to determine - static or list, +comments
vadymhlushko-mlnx ecdf8b6
Added auto compleation file
vadymhlushko-mlnx 42779c7
Add CLI Jinja templates
stepanblyschak 12bf0b2
Fix the generated function name is incorrect
stepanblyschak 0d5dfcf
Fix review comments
stepanblyschak 4c2f986
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into spm
stepanblyschak c8eaa66
update and enhance templates with multiple lists in container
stepanblyschak dd29e33
fix cli templates
stepanblyschak 0b0a0c1
Merge branch 'master' of github.com:azure/sonic-utilities into sonic-…
stepanblyschak 3c1b429
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak e91ff81
fix script
stepanblyschak b87e6fd
Merge branch 'master' of github.com:azure/sonic-utilities into spm_warm
stepanblyschak 62e2646
fix unresolved conftest.py
stepanblyschak 79cabb2
fix unresolved test_service_creator.py
stepanblyschak a23fe44
fix lgtm warning
stepanblyschak 16857c4
add clear list command
stepanblyschak f4be579
fix lgtm warning
stepanblyschak dfa3ccc
Parsing for static YANG models - sonic-flex_counter.yang, sonic-devic…
vadymhlushko-mlnx 6b75f4b
Done refactoring for parsing 'static' YANG models
vadymhlushko-mlnx d2be52b
Added parsing for 'dynamic' YANG models, done refactoring of whole code
vadymhlushko-mlnx 73a3b12
Done parser for 'grouping' BUT need to deeply test it, added function…
vadymhlushko-mlnx 718f8ab
align with implementation
647537c
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
fa6299c
generate cli from templates
9d9f66b
Table can only have 'static-objects' OR 'dynamic-objects'
vadymhlushko-mlnx 38f4365
add missing " in help for option
591aced
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
0826ac5
Added remove_keys(), get_mandatory()
vadymhlushko-mlnx 069000f
fix issues
594acce
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
53111a8
Merge branch 'master' of github.com:azure/sonic-utilities into spm_warm
stepanblyschak 0ba3cf4
improve manifest types validation
stepanblyschak 9ec118c
Merge branch 'spm' of github.com:stepanblyschak/sonic-utilities into …
stepanblyschak b33c79a
Merge branch 'master' of github.com:azure/sonic-utilities into spm-yang
stepanblyschak 782a353
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak 1723f0f
Refactored generator.py: generate_cli_plugin(), get_cli_plugin_path()
vadymhlushko-mlnx bfc08e8
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak 705d4e6
Merge branch 'spm_warm' of github.com:stepanblyschak/sonic-utilities …
stepanblyschak 3f03594
remove redundant file
stepanblyschak 1554f00
fix docstrings
stepanblyschak f7681b0
Merge branch 'spm_warm' of github.com:stepanblyschak/sonic-utilities …
stepanblyschak dccff0b
use swsscommon.ConfigDBConnector
stepanblyschak 0a78e19
Removed arguments from constructor of class CliGenerator, added funct…
vadymhlushko-mlnx f0fdbe2
integrate with cli generation tool
stepanblyschak 5784d6c
fix manager
stepanblyschak 65b125c
[sonic-cli-gen]
stepanblyschak 134b21e
[sonic-cli-gen]
stepanblyschak 049823f
manager fixes
stepanblyschak 30d2cb9
Added sceleton for UT, added additional check for yang_parser.py, cha…
vadymhlushko-mlnx 0d371de
Refactored _init_yang_module_and_containers()
vadymhlushko-mlnx 1593039
added 2 test cases
vadymhlushko-mlnx 867d9c1
[sonic_package_manager] flush once finished saving docker image into …
stepanblyschak 3f00843
move cli autogen to ServiceCreator
stepanblyschak b3b0a8e
Revert "[sonic-cli-gen]"
stepanblyschak def7607
Revert "[sonic-cli-gen]"
stepanblyschak 79071b1
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak ada4ca4
[sonic-cli-gen] add remove plugin method
stepanblyschak 661aefb
align method signature with CliGenerator
stepanblyschak ad7ee33
[sonic-cli-gen] put autogenerated plugins into plugins.auto
stepanblyschak 087c527
fix wrong parameters order when creating ServiceCreator
stepanblyschak 471a128
[sonic-cli-gen] fix show.py.j2 template
stepanblyschak 9c0aa8b
add an option to keep features config
stepanblyschak c3350d3
fix remove() got an unexpected keyword argumet register_feature
stepanblyschak 9004c1c
[sonic-cli-gen] put autogenerated plugins into plugins.auto
stepanblyschak 32e27a2
[sonic-cli-gen] fix show.py.j2 template
stepanblyschak 02e6d27
[sonic-cli-gen] add remove plugin method
stepanblyschak 41da5ed
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak ea97d66
python module name in plugins can be just simply a package name
stepanblyschak 0f7e896
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak 562a008
Merge branch 'sae-integration' of github.com:stepanblyschak/sonic-uti…
stepanblyschak cb7fa06
refactored past test cases, added new
vadymhlushko-mlnx 5737f5f
added test_dynamic_object_complex
vadymhlushko-mlnx a56bbb0
[sonic-cli-gen] implement grouping in show template
stepanblyschak 7b167a6
[sonic-cli-gen] implement grouping in show template
stepanblyschak 16e0cca
Reworked 'grouping' parser
vadymhlushko-mlnx b0fb3a9
Added 'group' to 'attrs'
vadymhlushko-mlnx 2008cbc
[sonic-package-manager] update feature configuration in case it requi…
stepanblyschak a282872
Improvements and fixes
stepanblyschak e2acf73
Fixed 'grouping' parsing
vadymhlushko-mlnx 3305faa
DONE. ALL UT PASSED
vadymhlushko-mlnx 30e8ac9
Refactored UT
vadymhlushko-mlnx 15aeb8c
Added docstrings, fixed names of variables
vadymhlushko-mlnx ea2c838
Added test_grouping_complex to the execution pipeline
vadymhlushko-mlnx f7a7ed2
Merge remote-tracking branch 'vadymh/sonic-cli-gen' into sonic-cli-gen
vadymhlushko-mlnx e18c888
Removed unused test YANG model
vadymhlushko-mlnx 7bd3ec9
Fixed indentation
vadymhlushko-mlnx d5dea7f
Added sonic-cli-gen remove cmd, reworked private initializer functions
vadymhlushko-mlnx b0d2171
[sonic-cli-gen] address review comments
stepanblyschak aa4af1c
Added new lines, fixed some docstrings
vadymhlushko-mlnx 718a431
removed type from docstring
vadymhlushko-mlnx 2907523
Added list_handler()
vadymhlushko-mlnx c2b1a32
[sonic-cli-gen] fix review comments
stepanblyschak a005d6d
[sonic-cli-gen] address review comments
stepanblyschak aa00b61
[sonic-cli-gen] fix review comments
stepanblyschak fd931ad
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak 5c4e219
Fixed comments, added list_handler() where needed
vadymhlushko-mlnx 6de672c
Added logger to CliGenerator class constructor
vadymhlushko-mlnx 2a2f9f2
Merge remote-tracking branch 'vadymh/sonic-cli-gen' into sonic-cli-gen
vadymhlushko-mlnx 1584fe3
pep8 for generator.py
vadymhlushko-mlnx 8f27d03
pep8 for the rest of files
vadymhlushko-mlnx aa6f806
pep8 for tests files, added comments to YANG models
vadymhlushko-mlnx 83ce9ee
Added handler for 1 'choice' 'case'
vadymhlushko-mlnx 702be74
Code style
vadymhlushko-mlnx c433a4c
Fixed review comments
vadymhlushko-mlnx ba45666
Merge branch 'spm_warm' of github.com:stepanblyschak/sonic-utilities …
stepanblyschak aa3a04d
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak a0c15ac
Merge branch 'sae-integration' into spm-yang
stepanblyschak 6244efe
fix review comments
stepanblyschak fc771e1
Merge branch 'sonic-cli-gen' of github.com:vadymhlushko-mlnx/sonic-ut…
stepanblyschak 8424b0b
fix review comments
stepanblyschak 62b929f
Merge branch 'spm-yang' of github.com:stepanblyschak/sonic-utilities …
stepanblyschak fab17a9
fix review comments
stepanblyschak d64b04f
Merge branch 'master' of github.com:azure/sonic-utilities into spm-yang
stepanblyschak 0aa7df7
fix LGTM warning
stepanblyschak b66a76d
Merge branch 'master' of github.com:azure/sonic-utilities into HEAD
stepanblyschak 4345a6a
initialize ConfigMgmt with init_cfg.json instead of running config to…
stepanblyschak 94cde8e
Changed tabs to spaces
vadymhlushko-mlnx 5fec4a7
Removed unnecessary config_db.json file
vadymhlushko-mlnx 96ccbf6
Merge branch 'master' into spm-yang
stepanblyschak 3cd8ad9
Added test case, added support for UT for sonic-cli-gen implementation
vadymhlushko-mlnx 607b254
Added registering of plugins to UT
vadymhlushko-mlnx 6816903
Fixed name
vadymhlushko-mlnx 2aee883
Added helper.load_and_register_plugins()
vadymhlushko-mlnx 9fea6db
Added test cases for sonic-device_metadata
vadymhlushko-mlnx 69926ed
Added cli_autogen_common.py, added separate dir for each cli_autogen …
vadymhlushko-mlnx dd7ec5e
Added backup and restore func for yang models
vadymhlushko-mlnx eb85200
Removed if-else UT login from generator.py
vadymhlushko-mlnx 5ccefa6
Added couple UT for device-neighbor
vadymhlushko-mlnx 37ac0b7
Added UT for update flow
vadymhlushko-mlnx 4402203
Fixed codestyle
vadymhlushko-mlnx 9d07092
Fixed codestyle
vadymhlushko-mlnx 5b6a8aa
Fixed test path variables
vadymhlushko-mlnx df1d329
[sonic-cli-gen] add docstrings
stepanblyschak 33bb73a
Merge branch 'master' into spm-yang
stepanblyschak a6d36dc
Merge commit 'refs/pull/1644/head' of github.com:azure/sonic-utilitie…
stepanblyschak 4ed03b2
Merge branch 'master' of github.com:azure/sonic-utilities into spm-yang
stepanblyschak d531699
remove sonic_cli_gen PR part
stepanblyschak 5219909
remove sonic_cli_gen PR part
stepanblyschak 987c085
remove sonic_cli_gen PR part
stepanblyschak eb57015
Merge branch 'master' of https://github.com/Azure/sonic-utilities int…
stepanblyschak bf05d42
handle review comments
stepanblyschak d0a2ff7
fix LGTM warning
stepanblyschak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,11 @@ | |
| config_mgmt.py provides classes for configuration validation and for Dynamic | ||
| Port Breakout. | ||
| ''' | ||
|
|
||
| import os | ||
| import re | ||
| import syslog | ||
| import yang as ly | ||
| from json import load | ||
| from sys import flags | ||
| from time import sleep as tsleep | ||
|
|
@@ -46,34 +49,38 @@ def __init__(self, source="configDB", debug=False, allowTablesWithoutYang=True): | |
| try: | ||
| self.configdbJsonIn = None | ||
| self.configdbJsonOut = None | ||
| self.source = source | ||
| self.allowTablesWithoutYang = allowTablesWithoutYang | ||
|
|
||
| # logging vars | ||
| self.SYSLOG_IDENTIFIER = "ConfigMgmt" | ||
| self.DEBUG = debug | ||
|
|
||
| self.sy = sonic_yang.SonicYang(YANG_DIR, debug=debug) | ||
| # load yang models | ||
| self.sy.loadYangModel() | ||
| # load jIn from config DB or from config DB json file. | ||
| if source.lower() == 'configdb': | ||
| self.readConfigDB() | ||
| # treat any other source as file input | ||
| else: | ||
| self.readConfigDBJson(source) | ||
| # this will crop config, xlate and load. | ||
| self.sy.loadData(self.configdbJsonIn) | ||
|
|
||
| # Raise if tables without YANG models are not allowed but exist. | ||
| if not allowTablesWithoutYang and len(self.sy.tablesWithOutYang): | ||
| raise Exception('Config has tables without YANG models') | ||
| self.__init_sonic_yang() | ||
|
|
||
| except Exception as e: | ||
| self.sysLog(doPrint=True, logLevel=syslog.LOG_ERR, msg=str(e)) | ||
| raise Exception('ConfigMgmt Class creation failed') | ||
|
|
||
| return | ||
|
|
||
| def __init_sonic_yang(self): | ||
| 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. | ||
| if self.source.lower() == 'configdb': | ||
| self.readConfigDB() | ||
| # treat any other source as file input | ||
| else: | ||
| self.readConfigDBJson(self.source) | ||
| # this will crop config, xlate and load. | ||
| self.sy.loadData(self.configdbJsonIn) | ||
|
|
||
| # Raise if tables without YANG models are not allowed but exist. | ||
| if not self.allowTablesWithoutYang and len(self.sy.tablesWithOutYang): | ||
| raise Exception('Config has tables without YANG models') | ||
|
|
||
| def __del__(self): | ||
| pass | ||
|
|
||
|
|
@@ -213,6 +220,70 @@ def writeConfigDB(self, jDiff): | |
|
|
||
| return | ||
|
|
||
| def add_module(self, yang_module_str, replace_if_exists=False): | ||
| """ | ||
| Validate and add new YANG module to the system. | ||
|
|
||
| Parameters: | ||
| yang_module_str (str): YANG module in string representation. | ||
|
|
||
| Returns: | ||
| None | ||
| """ | ||
|
|
||
| module_name = self.get_module_name(yang_module_str) | ||
| module_path = os.path.join(YANG_DIR, '{}.yang'.format(module_name)) | ||
| if os.path.exists(module_path) and not replace_if_exists: | ||
| raise Exception('{} already exists'.format(module_name)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. caller of add_module should be able to handle it gracefully.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The caller can catch the exception and handle it gracefully. |
||
| with open(module_path, 'w') as module_file: | ||
renukamanavalan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| module_file.write(yang_module_str) | ||
| try: | ||
| self.__init_sonic_yang() | ||
| except Exception: | ||
| os.remove(module_path) | ||
| raise | ||
|
|
||
| def remove_module(self, module_name): | ||
| """ | ||
| Remove YANG module on the system and validate. | ||
|
|
||
| Parameters: | ||
| module_name (str): YANG module name. | ||
|
|
||
| Returns: | ||
| None | ||
| """ | ||
|
|
||
| module_path = os.path.join(YANG_DIR, '{}.yang'.format(module_name)) | ||
| if not os.path.exists(module_path): | ||
| return | ||
| with open(module_path, 'r') as module_file: | ||
| yang_module_str = module_file.read() | ||
renukamanavalan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| try: | ||
| os.remove(module_path) | ||
| self.__init_sonic_yang() | ||
| except Exception: | ||
| self.add_module(yang_module_str) | ||
| raise | ||
|
|
||
| @staticmethod | ||
| def get_module_name(yang_module_str): | ||
| """ | ||
| Read yangs module name from yang_module_str | ||
|
|
||
| Parameters: | ||
| yang_module_str(str): YANG module string. | ||
|
|
||
| Returns: | ||
| str: Module name | ||
| """ | ||
|
|
||
| # Instantiate new context since parse_module_mem() loads the module into context. | ||
| sy = sonic_yang.SonicYang(YANG_DIR) | ||
| module = sy.ctx.parse_module_mem(yang_module_str, ly.LYS_IN_YANG) | ||
renukamanavalan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return module.name() | ||
|
|
||
|
|
||
| # End of Class ConfigMgmt | ||
|
|
||
| class ConfigMgmtDPB(ConfigMgmt): | ||
|
|
@@ -417,8 +488,8 @@ def _deletePorts(self, ports=list(), force=False): | |
| deps.extend(dep) | ||
|
|
||
| # No further action with no force and deps exist | ||
| if force == False and deps: | ||
| return configToLoad, deps, False; | ||
| if not force and deps: | ||
| return configToLoad, deps, False | ||
|
|
||
| # delets all deps, No topological sort is needed as of now, if deletion | ||
| # of deps fails, return immediately | ||
|
|
@@ -436,8 +507,8 @@ def _deletePorts(self, ports=list(), force=False): | |
| self.sy.deleteNode(str(xPathPort)) | ||
|
|
||
| # Let`s Validate the tree now | ||
| if self.validateConfigData()==False: | ||
| return configToLoad, deps, False; | ||
| if not self.validateConfigData(): | ||
| return configToLoad, deps, False | ||
|
|
||
| # All great if we are here, Lets get the diff | ||
| self.configdbJsonOut = self.sy.getData() | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.