X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Futils%2Fopenstack_utils.py;h=3093cb558062872b379946ebd4611d6b4358a019;hb=568259b1a056de7e08e568168bf0d881b427a54d;hp=a0d78ae947d440c3e477dc229a6b8c7e0763ced1;hpb=8b9cd64a7b26a8259fd39801ebe77089a10e33d5;p=functest.git diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py index a0d78ae94..3093cb558 100755 --- a/functest/utils/openstack_utils.py +++ b/functest/utils/openstack_utils.py @@ -115,8 +115,11 @@ def source_credentials(rc_file): with open(rc_file, "r") as f: for line in f: var = line.rstrip('"\n').replace('export ', '').split("=") - key = re.sub(r'^ *| *$', '', var[0]) - value = re.sub(r'^[" ]*|[ "]*$', '', "".join(var[1:])) + # The two next lines should be modified as soon as rc_file + # conforms with common rules. Be aware that it could induce + # issues if value starts with ' + key = re.sub(r'^["\' ]*|[ \'"]*$', '', var[0]) + value = re.sub(r'^["\' ]*|[ \'"]*$', '', "".join(var[1:])) os.environ[key] = value