Added yaml prettifer and using on initial persona

This commit is contained in:
Joshua Harlow
2012-03-16 15:32:39 -07:00
parent 86520a0470
commit 3be9e66d2d
2 changed files with 46 additions and 18 deletions

View File

@@ -1,11 +1,7 @@
---
description: Devstack.sh matching component installation.
supports:
- rhel-6
- ubuntu-oneiric
- fedora-16
options:
components:
# Order matters here!
- general
- db
- rabbit-mq
- keystone-client
@@ -16,16 +12,24 @@ components:
- quantum-client
- nova-client
- horizon
description: Devstack.sh matching component installation.
options: null
subsystems:
glance:
- api
- reg
nova:
- api
- cauth
- cert
- cpu
- net
- sched
- vol
- xvnc
glance:
- api
- reg
nova:
- api
- cauth
- cert
- cpu
- net
- sched
- vol
- xvnc
supports:
- rhel-6
- ubuntu-oneiric
- fedora-16
...

24
tools/yamlpretty.py Normal file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python
import yaml
import os
import sys
# See: http://pyyaml.org/wiki/PyYAMLDocumentation
if __name__ == "__main__":
args = list(sys.argv)
args = args[1:]
for fn in args:
data = None
with open(fn, 'r') as fh:
data = yaml.load(fh.read())
fh.close()
formatted = yaml.dump(data,
line_break="\n",
indent=4,
explicit_start=True,
explicit_end=True,
default_flow_style=False,
)
print formatted