Remove quotes when assigning values from an openrc
The magnum and neutron modules parse an openrc file and create key-value pairs by literally assigning the key to anything in front of an '=' and the value to everything after an '='. If the value is surrounded by quotes, do not include them. Depends-On: I4b1e7b5cb83061ea35108db545fdfa33cef037a5 Change-Id: Ib44d9fa63332286fe4e51bd818f80b5989815988
This commit is contained in:
parent
5e2c0c5b55
commit
14d2727c04
@ -142,7 +142,7 @@ class ManageMagnum(object):
|
||||
def _parse_openrc(self):
|
||||
"""Get credentials from an openrc file."""
|
||||
openrc_path = self.module.params['openrc_path']
|
||||
line_re = re.compile('^export (?P<key>OS_\w*)=(?P<value>[^\n]*)')
|
||||
line_re = re.compile('^export (?P<key>OS_\w*)=\'?(?P<value>[^\n\']*)')
|
||||
with open(openrc_path) as openrc:
|
||||
matches = [line_re.match(l) for l in openrc]
|
||||
return dict(
|
||||
|
@ -262,7 +262,7 @@ class ManageNeutron(object):
|
||||
def _parse_openrc(self):
|
||||
"""Get credentials from an openrc file."""
|
||||
openrc_path = self.module.params['openrc_path']
|
||||
line_re = re.compile('^export (?P<key>OS_\w*)=(?P<value>[^\n]*)')
|
||||
line_re = re.compile('^export (?P<key>OS_\w*)=\'?(?P<value>[^\n\']*)')
|
||||
with open(openrc_path) as openrc:
|
||||
matches = [line_re.match(l) for l in openrc]
|
||||
return dict(
|
||||
|
Loading…
Reference in New Issue
Block a user