Compare commits

..

7 Commits

2 changed files with 9 additions and 5 deletions

2
Jenkinsfile vendored
View File

@ -2,7 +2,7 @@ pipeline {
agent { label 'agent_smith' }
stages {
stage('recreate > build > reun container') {
stage('recreate > build > run container') {
steps {
sh "docker-compose up -d --force-recreate --build parse_saby"
}

View File

@ -10,7 +10,6 @@ class SimpleDB:
def __init__(self):
self._create_db_pool_from_vault()
self.pool
#init_oracle_client() Если работает нужно убрать!
def _handle_vault_exception(self, e: Exception, message: str):
"""
@ -37,22 +36,27 @@ class SimpleDB:
Подключение к Vault и создание пула соеденения.
"""
try:
# Подключение к Vault
# Подключение к Vault
client = hvac.Client(
url='https://vlt.dataekb.ru:8222',
token=environ.get('VAULT_TOKEN'),
)
except Exception as e:
self._handle_vault_exception(e, "Ошибка при создание покдлючения c Vault")
# Проверка авторизации в Vault
if not client.is_authenticated():
raise Exception("Vault authentication failed")
try:
# Чтение секретов из Vault
# Чтение секретов из Vault
secret_read_response = client.secrets.kv.v2.read_secret_version(
path='oracledb',
mount_point='kv'
)
except Exception as e:
self._handle_vault_exception(e, "Ошибка чтение скретов из Vault")
try:
# Создаем пул соединений
self.pool = create_pool(