def validate_power_type(power_type):
 power_types = get_power_types()
 if (not power_types):
  raise CX('you need to have fence-agents installed')
 if (power_type not in power_types):
  raise CX(('power management type must be one of: %s' % ','.join(power_types)))

def validate_power_type ( power_type ) : power_types = get_power_types ( ) if ( not power_types ) : raise CX ( 'you need to have fence-agents installed' ) if ( power_type not in power_types ) : raise CX ( ( 'power management type must be one of: %s' % ',' . join ( power_types ) ) )
check if a power management type is valid .