Skip to content

Commit

Permalink
remove pyyaml and introduce rumel.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Dhandre <[email protected]>
  • Loading branch information
digitronik committed Apr 30, 2019
1 parent 5bb9d38 commit a40fa23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions miqsel/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import click
import yaml
from ruamel.yaml import safe_load, safe_dump


class Configuration(object):
Expand All @@ -14,11 +14,11 @@ def __init__(self, conf_file=None):

def read(self):
with open(self.conf_file, "r") as ymlfile:
return yaml.load(ymlfile)
return safe_load(ymlfile)

def write(self, cfg):
with open(self.conf_file, "w") as ymlfile:
return yaml.safe_dump(cfg, ymlfile, default_flow_style=False)
return safe_dump(cfg, ymlfile, default_flow_style=False)


@click.command(help="Configure Miq Selenium Server")
Expand Down
6 changes: 3 additions & 3 deletions miqsel/env.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import click
import yaml
from ruamel.yaml import safe_load, safe_dump

from miqsel.config import Configuration

Expand Down Expand Up @@ -49,7 +49,7 @@ def read(self):
:return: dict
"""
with open(self.env_file, "r") as ymlfile:
return yaml.load(ymlfile)
return safe_load(ymlfile)

def write(self, cfg):
""" Write Environment file
Expand All @@ -58,7 +58,7 @@ def write(self, cfg):
"""
if self.in_env:
with open(self.env_file, "w") as ymlfile:
return yaml.safe_dump(cfg, ymlfile, default_flow_style=False)
return safe_dump(cfg, ymlfile, default_flow_style=False)
else:
click.echo(
"Project directory need set or run from Project directory; 'env.yaml' not updated"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open("README.md") as readme_file:
readme = readme_file.read()

install_requirements = ["Click>=5.0", "docker>=3.1", "PyYAML>=3.0"]
install_requirements = ["Click>=5.0", "docker>=3.1", "ruamel.yaml~=0.15"]

setup_requirements = ["setuptools_scm"]

Expand Down

0 comments on commit a40fa23

Please sign in to comment.