Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Removed old unused libvirt toXML method
Browse files Browse the repository at this point in the history
  • Loading branch information
labisso committed Jul 29, 2011
1 parent 8a47ed9 commit 6b0b686
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions control/src/python/workspacecontrol/defaults/lvrt/lvrt_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,44 +85,8 @@ def _toXML_template(self):
template = env.get_template(self._template)
xml1 = template.render(domain=self, os=self.os, devices=self.devices)
return _xml_normalize_pretty(xml1)

def _toXML_old(self):
x = StringIO()

x.write(LINE_ONE)
x.write(L(0, "<domain type='%s'>" % self._type))

if not self.name:
raise Exception("assuming <name> is required")

x.write(L(1, "<name>%s</name>" % self.name))

if self.bootloader:
x.write(L(1, "<bootloader>%s</bootloader>" % self.bootloader))

if not self.os:
raise Exception("assuming <os> is required")
x.write(self.os.toXML())

x.write(L(1, "<memory>%d</memory>" % self.memory))
x.write(L(1, "<vcpu>%d</vcpu>" % self.vcpu))

if self.on_poweroff:
x.write(L(1, "<on_poweroff>%s</on_poweroff>" % self.on_poweroff))
if self.on_reboot:
x.write(L(1, "<on_reboot>%s</on_reboot>" % self.on_reboot))
if self.on_crash:
x.write(L(1, "<on_crash>%s</on_crash>" % self.on_crash))

if not self.devices:
raise Exception("assuming <devices> is required")
x.write(self.devices.toXML())

x.write(L(0, "</domain>"))
content = x.getvalue()
x.close()
return content



class OS:

# Three Xen boot types:
Expand Down

0 comments on commit 6b0b686

Please sign in to comment.