def execute_ipmi_cmd(template=None):
 template = (template or [])
 def _execute_ipmi_cmd(f):
  def _execute(self, **kwargs):
   args = ['ipmitool']
   command = f(self, **kwargs)
   args.extend(command.split(' '))
   try:
    (out, __) = utils.execute(run_as_root=True, *args)
   except processutils.ProcessExecutionError:
    raise ipmiexcept.IPMIException(_('running ipmitool failure'))
   return _parse_output(out, template)
  return _execute
 return _execute_ipmi_cmd

def execute_ipmi_cmd ( template = None ) : template = ( template or [ ] ) def _execute_ipmi_cmd ( f ) : def _execute ( self , ** kwargs ) : args = [ 'ipmitool' ] command = f ( self , ** kwargs ) args . extend ( command . split ( ' ' ) ) try : ( out , __ ) = utils . execute ( run_as_root = True , * args ) except processutils . ProcessExecutionError : raise ipmiexcept . IPMIException ( _ ( 'running ipmitool failure' ) ) return _parse_output ( out , template ) return _execute return _execute_ipmi_cmd
decorator for the execution of ipmi command .