Exemple #1
0
 def reboot(self, options={}):
     """
     Schedule a system reboot.
     """
     report = RebootReport()
     details = {}
     apply = options.get('apply', True)
     if apply:
         minutes = options.get('minutes', 1)
         command = 'shutdown -r +%d' % minutes
         log.info(command)
         os.system(command)
         details = dict(minutes=minutes)
     report.succeeded(details=details)
     return report
Exemple #2
0
 def reboot(self, conduit, options):
     """
     Schedule a system reboot.
     @param conduit: A handler conduit.
     @type conduit: L{pulp.agent.lib.conduit.Conduit}
     @param options: reboot options
         Supported:
             apply (bool): Actually schedule the reboot.
             minutes (int): Minutes to delay the reboot.
     @type options: dict
     """
     report = RebootReport()
     apply = options.get('apply', True)
     if apply:
         minutes = options.get('minutes', 1)
         command = 'shutdown -r +%d' % minutes
         log.info(command)
         os.system(command)
         details = dict(minutes=minutes)
         report.set_succeeded(details)
     else:
         report.succeeded()
     return report
Exemple #3
0
 def reboot(self, conduit, options):
     """
     Schedule a system reboot.
     @param conduit: A handler conduit.
     @type conduit: L{pulp.agent.lib.conduit.Conduit}
     @param options: reboot options
         Supported:
             apply (bool): Actually schedule the reboot.
             minutes (int): Minutes to delay the reboot.
     @type options: dict
     """
     report = RebootReport()
     apply = options.get('apply', True)
     if apply:
         minutes = options.get('minutes', 1)
         command = 'shutdown -r +%d' % minutes
         log.info(command)
         os.system(command)
         details = dict(minutes=minutes)
         report.set_succeeded(details)
     else:
         report.succeeded()
     return report