Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move from pyyaml to ruamel.yaml to avoid errors on dumping to yaml files #7

Merged
merged 1 commit into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions osde2e-wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import git
import shutil
import threading
import yaml
from ruamel.yaml import YAML

yaml = YAML()

logging.basicConfig(level=logging.DEBUG,format='%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s',datefmt='%Y-%m-%d %H:%M:%S')

Expand Down Expand Up @@ -184,7 +186,7 @@ def _watcher(osde2ectl_cmd,account_config,my_path,cluster_count,delay):
logging.info('Getting status every %d seconds' % int(delay))

yaml.dump(account_config,open(my_path + "/account_config.yaml",'w'))
my_config = yaml.safe_load(open(my_path + "/account_config.yaml"))
my_config = yaml.load(open(my_path + "/account_config.yaml"))
my_thread = threading.currentThread()
cmd = [osde2ectl_cmd, "list", "--custom-config", "account_config.yaml"]

Expand Down Expand Up @@ -338,7 +340,7 @@ def main():

# load the account config yaml
try:
account_config = yaml.safe_load(open(args.account_config))
account_config = yaml.load(open(args.account_config))
except Exception as err:
logging.error(err)
logging.error('Failed to load account configuration yaml')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ elasticsearch
urllib3
elasticsearch_dsl
GitPython
PyYAML
ruamel.yaml