From: Phillip Shea Date: Fri, 28 Aug 2015 17:27:34 +0000 (-0700) Subject: Deprecate REST functions in UtilLibrary.py X-Git-Tag: release/lithium-sr2~40 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=d013c45cbf310d9f5129383047f18a1cbf9ac376;p=integration%2Ftest.git Deprecate REST functions in UtilLibrary.py Robot RequestsLibary should be used instead. Change-Id: If6af408e1095a088c3137c291011186c81bf3b4e Signed-off-by: Phillip Shea --- diff --git a/csit/libraries/UtilLibrary.py b/csit/libraries/UtilLibrary.py index 05ef69ab37..ed2de6b18a 100644 --- a/csit/libraries/UtilLibrary.py +++ b/csit/libraries/UtilLibrary.py @@ -10,13 +10,17 @@ from SSHLibrary import SSHLibrary import robot import time import re +import warnings global _cache def get(url, userId='admin', password='admin'): """Helps in making GET REST calls""" - + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) headers = {} headers['Accept'] = 'application/xml' @@ -30,6 +34,10 @@ def get(url, userId='admin', password='admin'): def nonprintpost(url, userId, password, data): """Helps in making POST REST calls without outputs""" + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) if userId is None: userId = 'admin' @@ -49,6 +57,10 @@ def nonprintpost(url, userId, password, data): def post(url, userId, password, data): """Helps in making POST REST calls""" + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) if userId is None: userId = 'admin' @@ -74,6 +86,10 @@ def post(url, userId, password, data): def delete(url, userId='admin', password='admin'): """Helps in making DELET REST calls""" + warnings.warn( + "Use the Robot RequestsLibrary rather than this. See DatastoreCRUD.robot for examples", + DeprecationWarning + ) print("delete all resources belonging to url"+url) session = _cache.switch("CLUSTERING_DELETE") resp = session.delete(url, auth=(userId, password)) # noqa