def stub_set_host_enabled(context, host_name, enabled):
 results = {True: 'enabled', False: 'disabled'}
 if (host_name == 'notimplemented'):
  raise NotImplementedError()
 elif (host_name == 'dummydest'):
  raise exception.ComputeHostNotFound(host=host_name)
 elif (host_name == 'host_c2'):
  return results[(not enabled)]
 else:
  return results[enabled]

def stub_set_host_enabled ( context , host_name , enabled ) : results = { True : 'enabled' , False : 'disabled' } if ( host_name == 'notimplemented' ) : raise NotImplementedError ( ) elif ( host_name == 'dummydest' ) : raise exception . ComputeHostNotFound ( host = host_name ) elif ( host_name == 'host_c2' ) : return results [ ( not enabled ) ] else : return results [ enabled ]
simulates three possible behaviours for vm drivers or compute drivers when enabling or disabling a host .