def get_power_command(power_type):
 if power_type:
  power_path1 = ('/sbin/fence_%s' % power_type)
  power_path2 = ('/usr/sbin/fence_%s' % power_type)
  for power_path in (power_path1, power_path2):
   if (os.path.isfile(power_path) and os.access(power_path, os.X_OK)):
    return power_path
 return None

def get_power_command ( power_type ) : if power_type : power_path1 = ( '/sbin/fence_%s' % power_type ) power_path2 = ( '/usr/sbin/fence_%s' % power_type ) for power_path in ( power_path1 , power_path2 ) : if ( os . path . isfile ( power_path ) and os . access ( power_path , os . X_OK ) ) : return power_path return None
get power management command path .