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")
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.
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):
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.
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):