- utils.header("Calling GetBootMedium for %s"%self.name())
- options = []
- if self.is_qemu():
- options.append('serial')
- options.append('no-hangcheck')
- encoded=self.test_plc.apiserver.GetBootMedium(self.test_plc.auth_root(),
- self.name(), 'node-iso', '', options)
- if (encoded == ''):
- raise Exception, 'GetBootmedium failed'
-
- filename="%s/%s.iso"%(self.nodedir(),self.name())
- utils.header('Storing boot medium into %s'%filename)
+ utils.header("Calling GetBootMedium for {}".format(self.name()))
+ # this would clearly belong in the config but, well ..
+ options = self.node_spec['bootmedium_options'] if 'bootmedium_options' in self.node_spec else []
+ encoded = self.test_plc.apiserver.GetBootMedium(
+ self.test_plc.auth_root(), self.name(), 'node-iso', '', options)
+ if encoded == '':
+ raise Exception('GetBootmedium failed')
+
+ filename = "{}/{}.iso".format(self.nodedir(), self.name())
+ utils.header('Storing boot medium into {}'.format(filename))
+
+ # xxx discovered with python3, but a long stading issue:
+ # encoded at this point is a str instead of a bytes
+ # Quick & dirty : we convert this explicitly to a bytearray
+ # Longer run : clearly it seems like the plcapi server side should
+ # tag its result with <base64></base64> rather than as a string
+ bencoded = str.encode(encoded)