Skip to content

Commit

Permalink
5.5.0 Release
Browse files Browse the repository at this point in the history
Signed-off-by: Slavomir Mazur <[email protected]>
  • Loading branch information
SlavomirMazurPantheon committed Aug 16, 2022
1 parent fd5f1df commit 6ec1a48
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 22 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ yang.egg-info
/parseAndPopulate/**/*.yang
/parseAndPopulate/**/*.xml
!/parseAndPopulate/template/compilationStatusTemplate.html
!/parseAndPopulateTest/testJson/prepare.json
!**/tests/resources/**/*.json
!/tests/resources/**/*.html
!**/tests/resources/**/*.html
!/utility/tests/resources/**/*.json
!secrets_oidc.json
# Ignore local versions
yang-catalog.ini
yang-catalog.service
*/yang-catalog.ini
*/yang-catalog.service
/venv/
/api/test.py
htmlcov/
.pytest_cache/*
138 changes: 138 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"configurations": [
{
"name": "Python: Flask API",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "${workspaceFolder}/api/yangCatalogApi.py",
"FLASK_ENV": "development",
"FLASK_DEBUG": "1" // 1 = enable DEBUG mode; 0 = disable DEBUG mode
},
"justMyCode": false,
"args": [
"run"
// "--no-debugger", // Comment out this line
// "--no-reload" // Comment out this line
],
"jinja": true
},
{
"name": "populate - RFC",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/parseAndPopulate/populate.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false,
"args": [
"--sdo",
"--dir",
"/var/yang/nonietf/yangmodels/yang/standard/ietf/RFC",
"--notify-indexing",
"--force-parsing"
]
},
{
"name": "populate - IANA",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/parseAndPopulate/populate.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false,
"args": [
"--sdo",
"--dir",
"/var/yang/nonietf/yangmodels/yang/standard/iana",
"--notify-indexing",
"--force-parsing"
]
},
{
"name": "draftPull",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/ietfYangDraftPull/draftPull.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "draftPullLocal",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/ietfYangDraftPull/draftPullLocal.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "openconfigPullLocal",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/ietfYangDraftPull/openconfigPullLocal.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "statistics",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/statistic/statistics.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/statistic",
"justMyCode": false
},
{
"name": "resolveExpiration",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/utility/resolveExpiration.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "recovery - save",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/recovery/recovery.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "removeUnused",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/utility/removeUnused.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "process-changed-mods",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/elasticsearchIndexing/process-changed-mods.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
},
{
"name": "receiver",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/api/receiver.py",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"justMyCode": false
}
]
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

* ##### vm.m.p - 2022-MM-DD

* ##### v5.5.0 - 2022-08-16

* Unit tests covering parse_directory.py (runCapabilities) improved [#543](https://github.com/YangCatalog/backend/issues/543)
* Unit tests covering modules.py improved [#543](https://github.com/YangCatalog/backend/issues/543)
* Unit tests covering groupings.py improved [#543](https://github.com/YangCatalog/backend/issues/543)
* Bugfix: resolving derived-semantic-version in some edge-cases [#548](https://github.com/YangCatalog/backend/issues/548)
* schema property creation refactored [#538](https://github.com/YangCatalog/backend/issues/538)
* Tracking API access using Matomo [deployment #151](https://github.com/YangCatalog/deployment/issues/151)
* resolver classes introduced [#531](https://github.com/YangCatalog/backend/issues/531)

* ##### v5.4.0 - 2022-07-08

* lxml package version bumped
Expand Down
31 changes: 13 additions & 18 deletions recovery/redisUsersRecovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,18 @@
import os
import time

from redis import Redis

import utility.log as log
from redis import Redis
from utility.create_config import create_config
from utility.staticVariables import backup_date_format
from utility.util import get_list_of_backups, job_log


class ScriptConfig:

def __init__(self):
self.help = __doc__
config = create_config()
self.log_directory = config.get('Directory-Section', 'logs')
self.temp_dir = config.get('Directory-Section', 'temp')
self.cache_directory = config.get('Directory-Section', 'cache')
self.redis_host = config.get('DB-Section', 'redis-host')
self.redis_port = config.get('DB-Section', 'redis-port')
# self.var_yang = config.get('Directory-Section', 'var')
self.help = 'Save or load the users database stored on redis. An automatic backup is made' \
' before a load is performed'
parser = argparse.ArgumentParser(description=self.help)
parser.add_argument('--name_save',
default=datetime.datetime.utcnow().strftime(backup_date_format),
Expand Down Expand Up @@ -81,18 +75,18 @@ def main(scriptConf=None):
start_time = int(time.time())
if scriptConf is None:
scriptConf = ScriptConfig()
log_directory = scriptConf.log_directory
cache_directory = scriptConf.cache_directory
temp_dir = scriptConf.temp_dir
redis_host = scriptConf.redis_host
redis_port = scriptConf.redis_port
config = create_config()
log_directory = config.get('Directory-Section', 'logs')
temp_dir = config.get('Directory-Section', 'temp')
cache_directory = config.get('Directory-Section', 'cache')
redis_host = config.get('DB-Section', 'redis-host')
redis_port = int(config.get('DB-Section', 'redis-port'))
args = scriptConf.args
backups = os.path.join(cache_directory, 'redis-users')

LOGGER = log.get_logger('recovery', os.path.join(log_directory, 'yang.log'))
LOGGER.info('Starting {} process of redis users database'.format(args.type))


if args.type == 'save':
data = {}
redis = Redis(host=redis_host, port=redis_port, db=2)
Expand Down Expand Up @@ -144,10 +138,11 @@ def main(scriptConf=None):
redis.sadd(key, *value)
elif isinstance(value, dict):
redis.hset(key, mapping=value)

LOGGER.info('Data loaded from {} successfully'.format(file_name))

LOGGER.info('Job finished successfully')


if __name__ == '__main__':
main()

0 comments on commit 6ec1a48

Please sign in to comment.