Skip to content

Commit

Permalink
feat(deprecate_yamlconfig): Deprecate yamlconfig (#192)
Browse files Browse the repository at this point in the history
* Fix to issue #179: removing yamlconfig, and using PyYAML itself instead
  • Loading branch information
rmontenegroo authored Apr 20, 2020
1 parent c096e53 commit f911ad0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pytest_docker_tools==0.2.0
pytest==3.3
pytest-cov==2.6.0
pytest-twisted==1.8
codecov==2.0.15
pytest==5.4.1
pytest-cov==2.8.1
pytest-twisted==1.12
codecov==2.0.17
flake8==3.6.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ prometheus-client==0.0.19
pytz
pyvmomi>=6.5
twisted>=14.0.2
yamlconfig
pyyaml
service-identity
6 changes: 4 additions & 2 deletions vmware_exporter/vmware_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pytz
import logging

from yamlconfig import YamlConfig
import yaml

# Twisted
from twisted.web.server import Site, NOT_DONE_YET
Expand Down Expand Up @@ -938,7 +938,9 @@ def __init__(self, args):
def configure(self, args):
if args.config_file:
try:
self.config = YamlConfig(args.config_file)
with open(args.config_file) as cf:
self.config = yaml.load(cf, Loader=yaml.FullLoader)

if 'default' not in self.config.keys():
logging.error("Error, you must have a default section in config file (for now)")
exit(1)
Expand Down

0 comments on commit f911ad0

Please sign in to comment.