def vm_state_from_status(status):
 for (state, task_map) in _STATE_MAP.iteritems():
  status_string = task_map.get('default')
  if (status.lower() == status_string.lower()):
   return state

def vm_state_from_status ( status ) : for ( state , task_map ) in _STATE_MAP . iteritems ( ) : status_string = task_map . get ( 'default' ) if ( status . lower ( ) == status_string . lower ( ) ) : return state
map the server status string to a vm state .