X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=csit%2Flibraries%2FUtilLibrary.py;h=6f65fd2061595c2be806a6bebeacd36dce56d465;hb=dd4942bf1fc9e5fd15cb3a26e26155967e2e22c4;hp=11eb79733a361631a01bbb7e2428e3120ea2df60;hpb=1c106006ffb33c1c60e2f8abe61e88a7bd95a7bd;p=integration%2Ftest.git diff --git a/csit/libraries/UtilLibrary.py b/csit/libraries/UtilLibrary.py index 11eb79733a..6f65fd2061 100644 --- a/csit/libraries/UtilLibrary.py +++ b/csit/libraries/UtilLibrary.py @@ -103,7 +103,7 @@ def delete(url, userId="admin", password="admin"): def Should_Not_Be_Type_None(var): """Keyword to check if the given variable is of type NoneType. If the - variable type does match raise an assertion so the keyword will fail + variable type does match raise an assertion so the keyword will fail """ if var is None: raise AssertionError("the variable passed was type NoneType") @@ -229,7 +229,7 @@ def kill_controller(ip, username, password, karafHome): def isolate_controller(controllers, username, password, isolated): - """ Isolate one controller from the others in the cluster + """Isolate one controller from the others in the cluster :param controllers: A list of ip addresses or host names as strings. :param username: Username for the controller to be isolated. @@ -264,13 +264,13 @@ def isolate_controller(controllers, username, password, isolated): iso_result = "pass" for controller in controllers: controller_regex_string = ( - "[\s\S]*" + isolated_controller + " *" + controller + "[\s\S]*" + r"[\s\S]*" + isolated_controller + " *" + controller + r"[\s\S]*" ) controller_regex = re.compile(controller_regex_string) if not controller_regex.match(ip_tables): iso_result = ip_tables controller_regex_string = ( - "[\s\S]*" + controller + " *" + isolated_controller + "[\s\S]*" + r"[\s\S]*" + controller + " *" + isolated_controller + r"[\s\S]*" ) controller_regex = re.compile(controller_regex_string) if not controller_regex.match(ip_tables): @@ -279,7 +279,7 @@ def isolate_controller(controllers, username, password, isolated): def rejoin_controller(controllers, username, password, isolated): - """ Return an isolated controller to the cluster. + """Return an isolated controller to the cluster. :param controllers: A list of ip addresses or host names as strings. :param username: Username for the isolated controller. @@ -314,13 +314,13 @@ def rejoin_controller(controllers, username, password, isolated): iso_result = "pass" for controller in controllers: controller_regex_string = ( - "[\s\S]*" + isolated_controller + " *" + controller + "[\s\S]*" + r"[\s\S]*" + isolated_controller + " *" + controller + r"[\s\S]*" ) controller_regex = re.compile(controller_regex_string) if controller_regex.match(ip_tables): iso_result = ip_tables controller_regex_string = ( - "[\s\S]*" + controller + " *" + isolated_controller + "[\s\S]*" + r"[\s\S]*" + controller + " *" + isolated_controller + r"[\s\S]*" ) controller_regex = re.compile(controller_regex_string) if controller_regex.match(ip_tables):