diff --git a/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos b/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos index 675879d15c..75b15094f0 100755 --- a/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos +++ b/nodepool/elements/cache-devstack/extra-data.d/55-cache-devstack-repos @@ -81,7 +81,7 @@ def tokenize(fn, tokens, distribution, comment=None): if 'qpid' in line: continue # TODO: explain why this is here if comment and comment in line: - line = line[:line.rfind(comment)] + line = line[:line.find(comment)] line = line.strip() if line and line not in tokens: tokens.append(line) @@ -94,7 +94,7 @@ def _legacy_find_images(basedir): line = line.strip() if line.startswith('IMAGE_URLS'): if '#' in line: - line = line[:line.rfind('#')] + line = line[:line.find('#')] if line.endswith(';;'): line = line[:-2] line = line.split('=', 1)[1].strip() diff --git a/nodepool/scripts/cache_devstack.py b/nodepool/scripts/cache_devstack.py index 379d13aa06..0c7505959b 100755 --- a/nodepool/scripts/cache_devstack.py +++ b/nodepool/scripts/cache_devstack.py @@ -46,7 +46,7 @@ def tokenize(fn, tokens, distribution, comment=None): if 'qpid' in line: continue # TODO: explain why this is here if comment and comment in line: - line = line[:line.rfind(comment)] + line = line[:line.find(comment)] line = line.strip() if line and line not in tokens: tokens.append(line) @@ -59,7 +59,7 @@ def _legacy_find_images(basedir): line = line.strip() if line.startswith('IMAGE_URLS'): if '#' in line: - line = line[:line.rfind('#')] + line = line[:line.find('#')] if line.endswith(';;'): line = line[:-2] line = line.split('=', 1)[1].strip()