-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #944 from seriva/fixes/init-fixes
Fixed addition of infrastructure documents when using --ful flag (#940) Switched from PyYAML to ruamel.yaml to preserve comments and commented out configs in the defaults. (#611) Fixed running epicli init -p any --full generating cloud sample configuration (#736) Checked if additional security rules for NSGs are applied properly for Azure (#942) Exclusion of SET_BY_AUTOMATION fields on generated configs Updated gen-licenses.py to use requirements.txt to generate licenses.py file instead of PipEnv
- Loading branch information
Showing
7 changed files
with
1,059 additions
and
1,304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
import yaml | ||
from ruamel.yaml import YAML | ||
from cli.helpers.objdict_helpers import objdict_to_dict, dict_to_objdict | ||
|
||
|
||
def safe_load_all(stream): | ||
docs = list(yaml.safe_load_all(stream)) | ||
yaml = YAML() | ||
yaml.default_flow_style = False | ||
docs = list(yaml.load_all(stream)) | ||
conv_docs = [] | ||
for doc in docs: | ||
conv_docs.append(dict_to_objdict(doc)) | ||
return conv_docs | ||
|
||
|
||
def safe_load(stream): | ||
doc = yaml.safe_load(stream) | ||
yaml = YAML() | ||
yaml.default_flow_style = False | ||
doc = yaml.load(stream) | ||
return dict_to_objdict(doc) | ||
|
||
|
||
def dump_all(docs, stream): | ||
yaml = YAML() | ||
yaml.default_flow_style = False | ||
doc2 = docs | ||
conv_docs = [] | ||
for doc in doc2: | ||
conv_docs.append(objdict_to_dict(doc)) | ||
yaml.dump_all(conv_docs, stream, default_flow_style=False) | ||
yaml.dump_all(conv_docs, stream) | ||
|
||
|
||
def dump(doc, stream): | ||
yaml.dump(objdict_to_dict(doc), stream, default_flow_style=False) | ||
yaml = YAML() | ||
yaml.default_flow_style = False | ||
yaml.dump(objdict_to_dict(doc), stream) | ||
|
Oops, something went wrong.