[bonfiredemokit] Annotation of /ea/xml_creator.py
Annotation of /ea/xml_creator.py
Parent Directory
| Revision Log
Revision 1 -
(view)
(download)
(as text)
1 : |
agomez |
1 |
'''
|
2 : |
|
|
Created on 16/03/2012
|
3 : |
|
|
|
4 : |
|
|
@author: cesga
|
5 : |
|
|
'''
|
6 : |
|
|
import xml.etree.ElementTree as tree
|
7 : |
|
|
|
8 : |
|
|
|
9 : |
|
|
def xml_creator():
|
10 : |
|
|
""" Devuelve un string en xml con el storage que queremos"""
|
11 : |
|
|
|
12 : |
|
|
top = tree.Element('storage xmlns="http://api.bonfire-project.eu/doc/schemas/occi"')
|
13 : |
|
|
#comment = Comment('Generated for PyMOTW')
|
14 : |
|
|
#top.append(comment)
|
15 : |
|
|
child = tree.SubElement(top, 'name')
|
16 : |
|
|
child.text = 'pruebadata'
|
17 : |
|
|
child = tree.SubElement(top, 'persistent')
|
18 : |
|
|
child.text = 'YES'
|
19 : |
|
|
child = tree.SubElement(top, 'size')
|
20 : |
|
|
child.text = '1024'
|
21 : |
|
|
child = tree.SubElement(top, 'type')
|
22 : |
|
|
child.text = 'DATABLOCK'
|
23 : |
|
|
child = tree.SubElement(top, 'fstype')
|
24 : |
|
|
child.text = 'ext3'
|
25 : |
|
|
|
26 : |
|
|
return tree.
|
27 : |
|
|
|
28 : |
|
|
|
29 : |
|
|
|
30 : |
|
|
|
31 : |
|
|
print xml_creator()
|
|