[bonfiredemokit] Annotation of /ea/xml_creator.py
Annotation of /ea/xml_creator.py
Parent Directory
| Revision Log
Revision 14 -
(view)
(download)
(as text)
1 : |
agomez |
10 |
#
|
2 : |
|
|
# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit
|
3 : |
|
|
#
|
4 : |
|
|
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012
|
5 : |
|
|
#
|
6 : |
agomez |
14 |
# License Apache Software
|
7 : |
agomez |
10 |
#
|
8 : |
|
|
# The research leading to these results has received funding from
|
9 : |
|
|
# the European Community's Seventh Framework Programme (FP7/2007-2013)
|
10 : |
|
|
# under agreement number 257386
|
11 : |
|
|
#
|
12 : |
|
|
# This software is provided with ABSOLUTELY NO WARRANTY
|
13 : |
|
|
#
|
14 : |
|
|
'''
|
15 : |
|
|
Created on 16/03/2012
|
16 : |
|
|
|
17 : |
|
|
@author: cesga
|
18 : |
|
|
'''
|
19 : |
|
|
import xml.etree.ElementTree as tree
|
20 : |
|
|
|
21 : |
|
|
|
22 : |
|
|
def xml_creator():
|
23 : |
|
|
""" Devuelve un string en xml con el storage que queremos"""
|
24 : |
|
|
|
25 : |
|
|
top = tree.Element('storage xmlns="http://api.bonfire-project.eu/doc/schemas/occi"')
|
26 : |
|
|
#comment = Comment('Generated for PyMOTW')
|
27 : |
|
|
#top.append(comment)
|
28 : |
|
|
child = tree.SubElement(top, 'name')
|
29 : |
|
|
child.text = 'pruebadata'
|
30 : |
|
|
child = tree.SubElement(top, 'persistent')
|
31 : |
|
|
child.text = 'YES'
|
32 : |
|
|
child = tree.SubElement(top, 'size')
|
33 : |
|
|
child.text = '1024'
|
34 : |
|
|
child = tree.SubElement(top, 'type')
|
35 : |
|
|
child.text = 'DATABLOCK'
|
36 : |
|
|
child = tree.SubElement(top, 'fstype')
|
37 : |
|
|
child.text = 'ext3'
|
38 : |
|
|
|
39 : |
|
|
return tree.
|
40 : |
|
|
|
41 : |
|
|
|
42 : |
|
|
|
43 : |
|
|
|
44 : |
|
|
print xml_creator()
|
|