From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek 'marx' Grac Date: Wed, 20 Nov 2013 17:35:13 +0100 Subject: [Cluster-devel] [PATCH 2/2] fencing: Add information about option that have to be selected from list to XML metadata In-Reply-To: <1384965313-12857-1-git-send-email-mgrac@redhat.com> References: <1384965313-12857-1-git-send-email-mgrac@redhat.com> Message-ID: <1384965313-12857-2-git-send-email-mgrac@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit --- fence/agents/lib/fencing.py.py | 7 ++++++- fence/agents/lib/metadata.rng | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index a19ae20..2b914f2 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -477,7 +477,12 @@ def metadata(avail_opt, options, docs): mixed = mixed.replace("<", "<").replace(">", ">") print "\t\t" - if all_opt[option]["getopt"].count(":") > 0: + if all_opt[option].has_key("choices"): + print "\t\t" + for choice in all_opt[option]["choices"]: + print "\t\t\t" + elif all_opt[option]["getopt"].count(":") > 0: print "\t\t" else: print "\t\t" diff --git a/fence/agents/lib/metadata.rng b/fence/agents/lib/metadata.rng index 2566fee..c7758e6 100644 --- a/fence/agents/lib/metadata.rng +++ b/fence/agents/lib/metadata.rng @@ -24,12 +24,24 @@ - - - boolean - string - - + + + + boolean + string + + + + + select + + + + + + + + -- 1.7.7.6