From patchwork Wed Sep 4 15:46:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Dawson X-Patchwork-Id: 2853792 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3C2C59F3DC for ; Wed, 4 Sep 2013 15:47:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFD5C20494 for ; Wed, 4 Sep 2013 15:47:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59161204AF for ; Wed, 4 Sep 2013 15:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935180Ab3IDPrD (ORCPT ); Wed, 4 Sep 2013 11:47:03 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:48291 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934941Ab3IDPrC (ORCPT ); Wed, 4 Sep 2013 11:47:02 -0400 Received: by mail-ie0-f172.google.com with SMTP id c10so1032275ieb.3 for ; Wed, 04 Sep 2013 08:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudapt.com; s=google; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=klxg0SVpBi0o+4ouJShenM4/JIv1e/29chZ+djmIfG8=; b=hehdly5ElFgHnlOC1dDc5SVFqmfhi9XFW1iw9ABl9v1lxv8iTphtJk1Mv2QBzk1tJ5 MNEtWGBu8mnKSCitBPGYWK2+tvZVqgmQri2MFY15DdFCqKIDT1GR8rCYsn8yHi/jA6k+ SftJf/vB+0KEZk37lnstb0qvNwt/6TbNMXjBM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=klxg0SVpBi0o+4ouJShenM4/JIv1e/29chZ+djmIfG8=; b=SzldChQvNiITtmJ4ntznt1lTRBQXxfoq1V87KeEM0WxLH4kM44KNcKlU8D6Hdnx6WV BofvTKIvZG/jPblhANXbcMk+7RjCBKTU9ybJv3z27Kb+IH5QsCE+ZcY+9IAurmzA55Wv 8FvMDkb2ZlZfqIf150FPTG0AvolzLbzlB0BNxD9dNvLPpl7LuP2vnBzmHUPQmAwGh4JD 0vo+YraV/t/yRUS3r7E+umQAn9UJr8j7CrAvQls0YmNIyzjkn+ftL68NZkXPij4cCcan tX9pR/RRvMFS2+ksrAzzw8pycFoD6ad/pvLWO0JEGc+vZqlAab0Sfj2GReOJdeWRLx1o j8hw== X-Gm-Message-State: ALoCoQlDe6jbrcj0Saw/KlgR3kigjnBNn3Gr05KFjuaPP6z+l2eiPKxCHF62JDcqzx6lfwRVOK3b X-Received: by 10.42.227.72 with SMTP id iz8mr2148740icb.27.1378309621285; Wed, 04 Sep 2013 08:47:01 -0700 (PDT) Received: from [10.10.1.142] (23-25-46-97-static.hfc.comcastbusiness.net. [23.25.46.97]) by mx.google.com with ESMTPSA id lp9sm4116625igb.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Sep 2013 08:47:00 -0700 (PDT) Message-ID: <522755F1.2000406@cloudapt.com> Date: Wed, 04 Sep 2013 11:46:57 -0400 From: Mike Dawson User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Mark Nelson , "ceph-devel@vger.kernel.org" Subject: Re: Add Metavariable $imagename References: <522747D0.6050906@cloudapt.com> <52274CA1.2040801@inktank.com> In-Reply-To: <52274CA1.2040801@inktank.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Thanks for the feature request Mark! To illustrate where my understanding ends, here is a patch to stub in this functionality: From 137ebc2d5326ca710a5e99e2899fd851b02c10f7 Mon Sep 17 00:00:00 2001 From: Mike Dawson Date: Wed, 4 Sep 2013 11:39:05 -0400 Subject: [PATCH] Update config.cc --- src/common/config.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) @@ -1007,6 +1007,8 @@ bool md_config_t::expand_meta(std::string &origval) const out += name.get_id().c_str(); else if (var == "pid") out += stringify(getpid()); + else if (var == "image-name") + out += "TBD" else assert(0); // unreachable found_meta = true; diff --git a/src/common/config.cc b/src/common/config.cc index 5c64f4e..89ac0ee 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -929,7 +929,7 @@ int md_config_t::set_val_raw(const char *val, const config_option *opt) } static const char *CONF_METAVARIABLES[] = - { "cluster", "type", "name", "host", "num", "id", "pid" }; + { "cluster", "type", "name", "host", "num", "id", "pid", "image-name" }; static const int NUM_CONF_METAVARIABLES = (sizeof(CONF_METAVARIABLES) / sizeof(CONF_METAVARIABLES[0]));