Example #1
0
 def on_entry(self):
     self.machine.clear_counter()
     try:
         data.get_pxe_config_for_device(self.machine.device_name,
                                        'self-test')
     except data.NotFound:
         self.machine.goto_state(pc_power_cycling)
     else:
         data.set_device_config(self.machine.device_name, 'self-test', '')
         self.machine.goto_state(pxe_power_cycling)
Example #2
0
 def on_please_image(self, args):
     try:
         data.get_pxe_config_for_device(self.machine.device_name,
                                        args['image'])
         self.logger.info('writing image %s, boot config %s to db' %
                          (args['image'], args['boot_config']))
         data.set_device_config(self.machine.device_name,
                                args['image'],
                                args['boot_config'])
         self.machine.goto_state(start_pxe_boot)
     except data.NotFound:
         self.logger.error('cannot image device')
Example #3
0
 def setup_pxe(self):
     # set the pxe config based on what's in the DB
     cfg = data.device_config(self.machine.device_name)
     try:
         pxe_config = data.get_pxe_config_for_device(self.machine.device_name)
     except data.NotFound:
         self.logger.warning('no appropriate PXE config found')
         self.machine.goto_state(failed_pxe_booting)
         return
     bmm_api.set_pxe(self.machine.device_name, pxe_config,
                     cfg['boot_config'])