--- ea/xml_creator.py 2012/08/30 12:48:07 9 +++ ea/xml_creator.py 2012/08/31 10:40:38 10 @@ -1,44 +1,44 @@ -# -# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit -# -# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012 -# -# License GPL Version 3 -# -# The research leading to these results has received funding from -# the European Community's Seventh Frameqork Programme (FP7/2007-2013) -# under agreement number 257386 -# -# This software is provided with ABSOLUTELY NO WARRANTY -# -''' -Created on 16/03/2012 - -@author: cesga -''' -import xml.etree.ElementTree as tree - - -def xml_creator(): - """ Devuelve un string en xml con el storage que queremos""" - - top = tree.Element('storage xmlns="http://api.bonfire-project.eu/doc/schemas/occi"') - #comment = Comment('Generated for PyMOTW') - #top.append(comment) - child = tree.SubElement(top, 'name') - child.text = 'pruebadata' - child = tree.SubElement(top, 'persistent') - child.text = 'YES' - child = tree.SubElement(top, 'size') - child.text = '1024' - child = tree.SubElement(top, 'type') - child.text = 'DATABLOCK' - child = tree.SubElement(top, 'fstype') - child.text = 'ext3' - - return tree. - - - - -print xml_creator() +# +# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit +# +# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012 +# +# License GPL Version 3 +# +# The research leading to these results has received funding from +# the European Community's Seventh Framework Programme (FP7/2007-2013) +# under agreement number 257386 +# +# This software is provided with ABSOLUTELY NO WARRANTY +# +''' +Created on 16/03/2012 + +@author: cesga +''' +import xml.etree.ElementTree as tree + + +def xml_creator(): + """ Devuelve un string en xml con el storage que queremos""" + + top = tree.Element('storage xmlns="http://api.bonfire-project.eu/doc/schemas/occi"') + #comment = Comment('Generated for PyMOTW') + #top.append(comment) + child = tree.SubElement(top, 'name') + child.text = 'pruebadata' + child = tree.SubElement(top, 'persistent') + child.text = 'YES' + child = tree.SubElement(top, 'size') + child.text = '1024' + child = tree.SubElement(top, 'type') + child.text = 'DATABLOCK' + child = tree.SubElement(top, 'fstype') + child.text = 'ext3' + + return tree. + + + + +print xml_creator()