(self, passwd)
| 480 | "/domain/devices/graphics/@passwd") |
| 481 | |
| 482 | def set_console_passwd(self, passwd): |
| 483 | xml = self._XMLDesc(VIR_DOMAIN_XML_SECURE) |
| 484 | root = ElementTree.fromstring(xml) |
| 485 | console_type = self.get_console_type() |
| 486 | try: |
| 487 | graphic = root.find("devices/graphics[@type='%s']" % console_type) |
| 488 | except SyntaxError: |
| 489 | # Little fix for old version ElementTree |
| 490 | graphic = root.find("devices/graphics") |
| 491 | if graphic is None: |
| 492 | return False |
| 493 | if passwd: |
| 494 | graphic.set('passwd', passwd) |
| 495 | else: |
| 496 | try: |
| 497 | graphic.attrib.pop('passwd') |
| 498 | except: |
| 499 | pass |
| 500 | newxml = ElementTree.tostring(root) |
| 501 | return self._defineXML(newxml) |
| 502 | |
| 503 | def set_console_keymap(self, keymap): |
| 504 | xml = self._XMLDesc(VIR_DOMAIN_XML_SECURE) |
no test coverage detected