Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Updating requirements to include dynaconf
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedar Vijay Kulkarni committed Oct 11, 2019
1 parent c03de3a commit 3f167ce
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
1 change: 0 additions & 1 deletion cfme/fixtures/parallelizer/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(self, config, slaveid, zmq_endpoint):
self.collection = None
self.slaveid = conf['env']['slaveid'] = slaveid
self.log = cfme.utils.log.logger
# conf.clear()
# Override the logger in utils.log

ctx = zmq.Context.instance()
Expand Down
18 changes: 9 additions & 9 deletions cfme/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import attr
import yaycl
from cached_property import cached_property
from dynaconf import LazySettings

from cfme.utils import path
Expand Down Expand Up @@ -56,7 +57,6 @@ class Configuration(object):
Holds ConfigData objects in dictionary `settings`.
"""
def __init__(self):
self.settings = None
self.yaycl_config = None

def configure_creds(self, config_dir, crypt_key_file=None):
Expand All @@ -79,7 +79,8 @@ def configure_creds(self, config_dir, crypt_key_file=None):
else:
self.yaycl_config = yaycl.Config(config_dir=config_dir)

def configure(self):
@cached_property
def settings(self):
"""
Loads all the congfigs in settings dictionary where Key is filename(without extension)
and value is ConfigData object relevant to that file.
Expand All @@ -94,19 +95,18 @@ def configure(self):
'perf_tests': <cfme.utils.config_copy.ConfigData at 0x7f2a943ad2e8>}
"""
if self.settings is None:
self.settings = {
file.basename[:-5]: ConfigData(env=file.basename[:-5])
for file in path.conf_path.listdir() if file.basename[-5:] == '.yaml' and
'.local.yaml' not in file.basename
}
settings = {
f.purebasename: ConfigData(env=f.purebasename)
for f in path.conf_path.listdir() if '.local.yaml' not in f.basename and
f.ext in ['.yaml', '.yml']
}
return settings

def get_config(self, name):
"""returns a config object
:param name: name of the configuration object
"""
self.configure()
if name in YAML_KEYS:
if name == 'credentials' or name == 'hidden':
return getattr(self.yaycl_config, name)
Expand Down
7 changes: 0 additions & 7 deletions cfme/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,6 @@ def process(self, message, kwargs):


def _load_conf(logger_name=None):
# Reload logging conf from env, then update the logging_conf
# try:
# del(conf['env'])
# except KeyError:
# # env not loaded yet
# pass

logging_conf = _default_conf.copy()

yaml_conf = conf.env.get('logging', {})
Expand Down
1 change: 1 addition & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
azure-storage-common==1.4.0
dynaconf[all]==2.2.0
pdfminer.six==20181108
pytest<=3.4.1
websocket-client<=0.40.2,>=0.32.0
13 changes: 12 additions & 1 deletion requirements/frozen.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
https://github.com/rochacbruno/dynaconf/tarball/master
adal==1.2.1
aenum==2.1.2
alabaster==0.7.12
amqp==2.5.1
ansible==2.8.5
anytree==2.6.0
apipkg==1.5
Expand Down Expand Up @@ -95,6 +95,7 @@ Babel==2.6.0
backcall==0.1.0
bambou==3.0.1
bcrypt==3.1.6
billiard==3.6.1.0
bleach==3.1.0
boto==2.49.0
boto3==1.6.6
Expand All @@ -113,6 +114,7 @@ Click==7.0
cliff==2.14.1
cmd2==0.9.11
colorama==0.4.1
configobj==5.0.6
cryptography==2.6.1
cycler==0.10.0
dateparser==0.7.2
Expand All @@ -130,6 +132,7 @@ docker-pycreds==0.4.0
docutils==0.15.2
dogpile.cache==0.7.1
dump2polarion==0.46.0
dynaconf==2.2.0
ecdsa==0.13.2
entrypoints==0.3
fauxfactory==3.0.6
Expand All @@ -147,6 +150,7 @@ google-compute-engine==2.8.13
greenlet==0.4.15
httplib2==0.12.1
humanfriendly==4.18
hvac==0.9.5
identify==1.4.7
idna==2.8
imagesize==1.1.0
Expand Down Expand Up @@ -174,6 +178,7 @@ jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
keystoneauth1==3.17.1
kombu==4.6.4
kubernetes==3.0.0
kwargify==2.2.0
layered-yaml-attrdict-config==18.12.3
Expand Down Expand Up @@ -258,10 +263,12 @@ pyperclip==1.7.0
pytesseract==0.3.0
pytest==3.4.1
pytest-polarion-collect==0.21.0
pytest-report-parameters==0.4.0
python-box==3.2.4
python-bugzilla==2.3.0
python-cinderclient==4.1.0
python-dateutil==2.8.0
python-dotenv==0.10.3
python-glanceclient==2.16.0
python-heatclient==1.17.0
python-ironicclient==2.7.0
Expand All @@ -280,6 +287,7 @@ PyYAML==5.1
pyzmq==18.0.1
qtconsole==4.4.3
redfish-client==0.1.0
redis==3.3.10
reg==0.11
regex==2019.4.14
repoze.lru==0.7
Expand Down Expand Up @@ -315,6 +323,7 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
SQLAlchemy==1.3.8
sqlparse==0.3.0
stevedore==1.30.1
suds-jurko==0.6
tabulate==0.8.3
Expand All @@ -327,6 +336,7 @@ traitlets==4.3.2
tzlocal==2.0.0
uritemplate==3.0.0
urllib3==1.25.6
vine==1.3.0
virtualenv==16.4.3
vspk==5.3.2
wait-for==1.1.0
Expand All @@ -341,6 +351,7 @@ widgetsnbextension==3.4.2
wrapanapi==3.4.1
wrapt==1.11.1
xmltodict==0.12.0
yamlordereddictloader==0.4.0
yaycl==0.3.0
yaycl-crypt==0.4.0
zipp==0.6.0
1 change: 0 additions & 1 deletion requirements/frozen_docs.py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# currently requirements/freeze_all.py needs to be executed for both python2 and python3 !
# to upgrade a single package use requirements/freeze_all.py --upgrade-only apackage

https://github.com/rochacbruno/dynaconf/tarball/master
adal==1.2.2
aenum==2.1.2
alabaster==0.7.12
Expand Down
1 change: 1 addition & 0 deletions requirements/template_scanned_imports.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ debtcollector
deepdiff
diaper
docker-py
dynaconf[all]
fauxfactory
gevent
humanfriendly
Expand Down

0 comments on commit 3f167ce

Please sign in to comment.