Project

General

Profile

Bug #7103

config: variable substitution happen only once

Added by Loïc Dachary over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
common
Target version:
-
% Done:

90%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

In ceph.conf if

mon_host = localhost
keyring = $mon_host/$cluster.keyring,$mon_host/$cluster.mon.keyring

it will be expanded to

keyring = localhost/ceph.keyring,$mon_host/ceph.mon.keyring

instead of the expected

keyring = localhost/ceph.keyring,localhost/ceph.mon.keyring

Associated revisions

Revision 5bb1545e (diff)
Added by Loïc Dachary over 9 years ago

common: multiple variable occurence expansion test

http://tracker.ceph.com/issues/7103 refs #7103

Signed-off-by: Loic Dachary <>

Revision 94854090 (diff)
Added by Loïc Dachary over 9 years ago

common: recursive implementation of config::expand_meta

Using a recursive implementation of variable expansions make it easier
to protect against loops and provide human readable messages when they
happen.

It also enables one variable to be substituted multiple times in the
same configuration option instead of just once because it is confused
with a variable expansion loop.

http://tracker.ceph.com/issues/7103 fixes: #7103

Signed-off-by: Loic Dachary <>

History

#1 Updated by Loïc Dachary over 9 years ago

  • Subject changed from variable substitution happen only once to config: variable substitution happen only once
  • Status changed from New to 12

The test demonstrating the problem fails with:

[ RUN      ] DaemonConfig.SubstitutionMultiple
test/daemon_config.cc:136: Failure
Value of: tmp
  Actual: "localhost/ceph.keyring,$mon_host/ceph.mon.keyring" 
Expected: string("localhost/ceph.keyring,localhost/ceph.mon.keyring")
Which is: "localhost/ceph.keyring,localhost/ceph.mon.keyring" 
[  FAILED  ] DaemonConfig.SubstitutionMultiple (0 ms)

#2 Updated by Loïc Dachary over 9 years ago

  • Status changed from 12 to In Progress

#3 Updated by Loïc Dachary over 9 years ago

  • Description updated (diff)

#4 Updated by Loïc Dachary over 9 years ago

  • Status changed from In Progress to Fix Under Review
  • % Done changed from 0 to 90

#5 Updated by Sage Weil over 9 years ago

  • Status changed from Fix Under Review to Resolved

Also available in: Atom PDF