def label_absent(name, node=None, apiserver_url=None):
 ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
 node = _guess_node_id(node)
 apiserver_url = _guess_apiserver(apiserver_url)
 if (apiserver_url is None):
  return False
 old_labels = _get_labels(node, apiserver_url)
 labels = dict([(key, value) for (key, value) in old_labels.items() if (key != name)])
 if (labels == old_labels):
  ret['comment'] = 'Label {0} already absent'.format(name)
 else:
  res = _set_labels(node, apiserver_url, labels)
  if (res.get('status') == 409):
   log.debug('Got 409, will try later')
   ret['changes'] = {}
   ret['comment'] = 'Could not delete label {0}, please retry'.format(name)
  else:
   ret['changes'] = {'deleted': name}
   ret['comment'] = 'Label {0} absent'.format(name)
 return ret

def label_absent ( name , node = None , apiserver_url = None ) : ret = { 'name' : name , 'result' : True , 'comment' : '' , 'changes' : { } } node = _guess_node_id ( node ) apiserver_url = _guess_apiserver ( apiserver_url ) if ( apiserver_url is None ) : return False old_labels = _get_labels ( node , apiserver_url ) labels = dict ( [ ( key , value ) for ( key , value ) in old_labels . items ( ) if ( key != name ) ] ) if ( labels == old_labels ) : ret [ 'comment' ] = 'Label {0} already absent' . format ( name ) else : res = _set_labels ( node , apiserver_url , labels ) if ( res . get ( 'status' ) == 409 ) : log . debug ( 'Got 409, will try later' ) ret [ 'changes' ] = { } ret [ 'comment' ] = 'Could not delete label {0}, please retry' . format ( name ) else : ret [ 'changes' ] = { 'deleted' : name } ret [ 'comment' ] = 'Label {0} absent' . format ( name ) return ret
ensure the label doesnt exist on the kube node .