def _set_labels(node, apiserver_url, labels):
 url = '{0}/api/v1/nodes/{1}'.format(apiserver_url, node)
 data = [{'op': 'replace', 'path': '/metadata/labels', 'value': labels}]
 ret = _kpatch(url, data)
 if (ret.get('status') == 404):
  return "Node {0} doesn't exist".format(node)
 return ret

def _set_labels ( node , apiserver_url , labels ) : url = '{0}/api/v1/nodes/{1}' . format ( apiserver_url , node ) data = [ { 'op' : 'replace' , 'path' : '/metadata/labels' , 'value' : labels } ] ret = _kpatch ( url , data ) if ( ret . get ( 'status' ) == 404 ) : return "Node {0} doesn't exist" . format ( node ) return ret
replace labels dict by a new one .