def set_robotframework_vars(cls, odlusername="admin", odlpassword="admin"):
"""Set credentials in csit/variables/Variables.robot.
Returns:
True if credentials are set.
False otherwise.
"""
try:
for line in fileinput.input(cls.odl_variables_file,
inplace=True):
print(re.sub("@{AUTH}.*",
"@{{AUTH}} {} {}".format(
odlusername, odlpassword),
line.rstrip()))
return True
except Exception: # pylint: disable=broad-except
cls.__logger.exception("Cannot set ODL creds:")
return False
评论列表
文章目录