def apply_change(targetState, name):
 if (targetState == 'present'):
  set_locale(name, enabled=True)
 else:
  set_locale(name, enabled=False)
 localeGenExitValue = call('locale-gen')
 if (localeGenExitValue != 0):
  raise EnvironmentError(localeGenExitValue, ('locale.gen failed to execute, it returned ' + str(localeGenExitValue)))

def apply_change ( targetState , name ) : if ( targetState == 'present' ) : set_locale ( name , enabled = True ) else : set_locale ( name , enabled = False ) localeGenExitValue = call ( 'locale-gen' ) if ( localeGenExitValue != 0 ) : raise EnvironmentError ( localeGenExitValue , ( 'locale.gen failed to execute, it returned ' + str ( localeGenExitValue ) ) )
create or remove locale .