Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2012-09-23 17:31:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "crmsh", Maintainer is "dmuhameda...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2012-09-15 17:26:23.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2012-09-23 17:31:41.000000000 +0200 @@ -1,0 +2,11 @@ +Tue Sep 18 15:47:25 UTC 2012 - dmuhameda...@suse.com + +- help: add topics to the help system +- help: add '?' as alias for help +- help: append slash to levels in overview help screen +- help: page overview help screens +- ui: add vim syntax highlighting support +- utils: use crm_simulate if ptest is not available +- upstream cs: df0b30262868 (release 1.2.0) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.Dni03f/_old 2012-09-23 17:31:43.000000000 +0200 +++ /var/tmp/diff_new_pack.Dni03f/_new 2012-09-23 17:31:43.000000000 +0200 @@ -35,16 +35,24 @@ %global crmsh_release %{specversion} +%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} +%define pkg_group System Environment/Daemons +%else +%define pkg_group Productivity/Clustering/HA +%endif + Name: crmsh Summary: Pacemaker command line interface License: GPL-2.0 -Group: Productivity/Clustering/HA -Version: 1.1.0 +Group: %{pkg_group} +Version: 1.2.0 Release: 0 Url: http://savannah.nongnu.org/projects/crmsh Source0: crmsh.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if 0%{?suse_version} Requires(pre): pacemaker-ticket-support >= 2.0 +%endif Requires(pre): pacemaker >= 1.1.6 Requires: pssh Requires: python >= 2.4 @@ -62,8 +70,13 @@ BuildRequires: asciidoc BuildRequires: autoconf BuildRequires: automake +%if 0%{?suse_version} BuildRequires: libglue-devel BuildRequires: libpacemaker-devel +%else +BuildRequires: cluster-glue-libs-devel +BuildRequires: pacemaker-libs-devel +%endif BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: python @@ -121,6 +134,13 @@ %install %make_install +%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} +# docs magically end up in /usr/share/doc/crmsh-$version on Fedora etc. +# so if we don't get rid of 'em here, they'll end up duplicated, which +# by default causes an "Installed (but unpackaged) file(s) found" error +# during build. +rm -r %{buildroot}%{crmsh_docdir} +%endif %if 0%{?with_regression_tests} %post @@ -152,6 +172,7 @@ %doc AUTHORS %doc ChangeLog %doc README +%doc contrib %dir %attr (770, %{uname}, %{gname}) %{_var}/cache/crm ++++++ crmsh.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/.hg_archival.txt new/crmsh/.hg_archival.txt --- old/crmsh/.hg_archival.txt 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/.hg_archival.txt 2012-09-18 17:40:54.000000000 +0200 @@ -1,5 +1,5 @@ repo: 13c3bd69e935090cd25213c474cafc3f01b5910b -node: a4f00b8fb5c8d8014285d4a499e847b89f9851b6 +node: df0b30262868a52fc5f21177fdb3d4a02badb49d branch: default -latesttag: Pacemaker-1.1.5 -latesttagdistance: 160 +latesttag: crmsh-1.2.0 +latesttagdistance: 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/.hgtags new/crmsh/.hgtags --- old/crmsh/.hgtags 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/.hgtags 2012-09-18 17:40:54.000000000 +0200 @@ -17,3 +17,4 @@ f731b72e3c82226b22c133a27462a019055f39e7 Pacemaker-1.0.3 f731b72e3c82226b22c133a27462a019055f39e7 SLE11-HAE-GMC fd6bd4648675c2be80c7bed2d8f8d3e5a5074c59 Pacemaker-1.0.5 +45886ac2c124ce49fc004dbc080974dc76dea605 crmsh-1.2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/ChangeLog new/crmsh/ChangeLog --- old/crmsh/ChangeLog 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/ChangeLog 2012-09-18 17:40:54.000000000 +0200 @@ -1,3 +1,74 @@ +* Tue Sep 18 2012 Dejan Muhamedagic <de...@suse.de> and many others +- stable release 1.2.0 +- cibconfig: support the kind attribute in orders +- cibconfig: implement node-attribute in collocations +- cibconfig: support require-all in resource sets +- cibconfig: support for fencing-topology +- cibconfig: new schema command +- rsctest: resource testing +- history: implement session saving +- history: add alias (timeframe) for the limit command +- xml: support for RNG schema +- site: ticket standby and activate commands +- site: update interface to crm_ticket +- cibstatus: ticket management +- ui: add vim syntax highlighting support +- xml: retrieve data from schema (lf#2092) +- stonith: support rhcs fence-agents (bnc#769724) +- ticket: fix redirecting rsc references in tickets (bnc#763465) +- ui: import readline only when needed (don't print ".[?1034h") +- ui: don't accept non-ascii input (lf#2597) +- ui: enable wait (option -w) for single-shot configure commands +- shadow: calculate shadow directory just like crm_shadow (bnc#759056) +- utils: improve terminal output height calculation (pager) +- utils: use crm_simulate if ptest is not available +- utils: repair ptest usage (bnc#736212) +- utils: prevent spurious error messages if an element doesn't + exist in CIB (bnc#723677) +- cibconfig: drop attributes set to default on cib import +- cibconfig: support setting attributes in resource sets +- cibconfig: display referenced attr set ids (lf#2304) +- cibconfig: don't verify parameters starting with '$' +- cibconfig: fix meta attributes verify for container elements (lf#2555) +- cibconfig: test for duplicate monitor intervals (lf#2586) +- cibconfig: don't skip monitor operations on verify +- cibconfig: use uname instead of id when listing nodes (cl#5043) +- cibconfig: repair resource parameter uniqueness test +- cibconfig: repair ability to manage multiple rsc/op_defaults (bnc#737812) +- cibconfig: remove also elements which depend on the resource + template which is to be deleted (bnc#730404) +- cibconfig: report error if a referenced template in primitive + doesn't exist (bnc#730404) +- cibconfig: exchange rsc and with-rsc after converting collocation + sets to standard constraints (bnc#729628) +- cibconfig: convert resource sets to standard constraints on + resource removal (bnc#729628) +- ra: don't require certain parameters for rhcs stonith resources +- ra: use only effective UID when choosing RA interface +- ra: always use lrmadmin with glue 1.0.10 (cl#5036) +- ra: fix start/stop interval test +- completion: add command aliases to completion tables (cl#5013) +- completion: add templates as possible resource references in + constraints +- history: improve limiting the report time period +- history: tune resource match patterns +- history: reset time period when setting source +- history: add clone/ms resources to events (fixes the transition command) +- history: expand clones and ms in the resource command (bnc#729631) +- history: don't assume that a hb_report tarball name matches the + top directory name +- history: handle non-existing source better (bnc#728346) +- history: fix regression when fetching new PE inputs (bnc#723417) +- history: use debug severity for repeating messages (bnc#726611) +- help: page overview help screens +- help: append slash to levels in overview help screen +- help: add '?' as alias for help +- help: add topics to the help system +- doc: describe deficiency in the configure edit command (bnc#715698) +- move user files to standard locations (XDG) +- build: add optional regression testing on rpm build +- build: fetch the daemon location from glue-config.h + * Wed Oct 19 2011 Dejan Muhamedagic <de...@suse.de> and many others - stable release 1.1.0 - history/troubleshooting support diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/configure.ac new/crmsh/configure.ac --- old/crmsh/configure.ac 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/configure.ac 2012-09-18 17:40:54.000000000 +0200 @@ -21,7 +21,7 @@ dnl checks for library functions dnl checks for system services -AC_INIT(crmsh, 1.0.0, pacema...@oss.clusterlabs.org) +AC_INIT(crmsh, 1.2.0, linux-ha@linux...@lists.linux-ha.org) AC_ARG_WITH(version, [ --with-version=version Override package version (if you're a packager needing to pretend) ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/contrib/README.vimsyntax new/crmsh/contrib/README.vimsyntax --- old/crmsh/contrib/README.vimsyntax 1970-01-01 01:00:00.000000000 +0100 +++ new/crmsh/contrib/README.vimsyntax 2012-09-18 17:40:54.000000000 +0200 @@ -0,0 +1,24 @@ +There are two VIM syntax files contributed: + +pacemaker-crm.vim +pcmk.vim + +Neither matches colours used in crm configure show and both need +to be improved. Still, you may want to edit a more colorful +configuration. To have that in "crm configure edit" do the +following: + +Copy one of them to ~/.vim/syntax/pcmk.vim. + +Don't forget to put "syntax on" in the VIM rc file (~/.vimrc or +~/.exrc). + +If you're editing a file directly, just type: + +:setf pcmk + +Many thanks to the contributors: + +Trevor Hemsley <thems...@voiceflex.com> +Dan Frincu <df.clus...@gmail.com> +Lars Ellenberg <l...@linbit.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/contrib/pacemaker-crm.vim new/crmsh/contrib/pacemaker-crm.vim --- old/crmsh/contrib/pacemaker-crm.vim 1970-01-01 01:00:00.000000000 +0100 +++ new/crmsh/contrib/pacemaker-crm.vim 2012-09-18 17:40:54.000000000 +0200 @@ -0,0 +1,129 @@ +" Vim syntax file +" Language: pacemaker-crm configuration style (http://www.clusterlabs.org/doc/crm_cli.html) +"" Filename: pacemaker-crm.vim +"" Language: pacemaker crm configuration text +"" Maintainer: Lars Ellenberg <l...@linbit.com> +"" Last Change: Thu, 18 Feb 2010 16:04:36 +0100 + +"What to do to install this file: +" $ mkdir -p ~/.vim/syntax +" $ cp pacemaker-crm.vim ~/.vim/syntax +" to set the filetype manually, just do :setf pacemaker-crm +" TODO: autodetection logic, maybe +" augroup filetypedetect +" au BufNewFile,BufRead *.pacemaker-crm setf pacemaker-crm +" augroup END +" +"If you do not already have a .vimrc with syntax on then do this: +" $ echo "syntax on" >>~/.vimrc +" +"Now every file with a filename matching *.pacemaker-crm will be edited +"using these definitions for syntax highlighting. + +" TODO: maybe add some indentation rules as well? + + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +"if version < 600 +" syntax clear +"elseif exists("b:current_syntax") +" finish +"endif +syn clear + +syn sync lines=30 +syn case ignore + +syn match crm_unexpected /[^ ]\+/ + +syn match crm_lspace transparent /^[ \t]*/ nextgroup=crm_node,crm_container,crm_head +syn match crm_tspace_err /\\[ \t]\+/ +syn match crm_tspace_err /\\\n\(primitive\|node\|group\|ms\|order\|location\|colocation\|property\).*/ +syn match crm_node transparent /\<node \$id="[^" ]\+" \([a-z0-9.-]\+\)\?/ + \ contains=crm_head,crm_assign,crm_nodename + \ nextgroup=crm_block + +syn region crm_block transparent keepend contained start=/[ \t]/ skip=/\\$/ end=/$/ + \ contains=crm_assign,crm_key,crm_meta,crm_tspace_err,crm_ops +syn region crm_order_block transparent keepend contained start=/[ \t]/ skip=/\\$/ end=/$/ + \ contains=crm_order_ref +syn region crm_colo_block transparent keepend contained start=/[ \t]/ skip=/\\$/ end=/$/ + \ contains=crm_colo_ref +syn region crm_meta transparent keepend contained start=/[ \t]meta\>/ skip=/\\$/ end=/$/ end=/[ \t]\(params\|op\)[ \t]/ + \ contains=crm_key,crm_meta_assign + +syn keyword crm_container contained group clone ms nextgroup=crm_id +syn keyword crm_head contained node +syn keyword crm_head contained property nextgroup=crm_block +syn keyword crm_head contained primitive nextgroup=crm_res_id +syn keyword crm_head contained location nextgroup=crm_id +syn match crm_id contained nextgroup=crm_ref,crm_block /[ \t]\+\<[a-z0-9_-]\+\>/ + +syn keyword crm_head contained colocation nextgroup=crm_colo_id +syn match crm_colo_id contained nextgroup=crm_colo_score /[ \t]\+\<[a-z0-9_-]\+\>/ +syn match crm_colo_score contained nextgroup=crm_colo_block /[ \t]\+\(-\?inf\|mandatory\|advisory\|#[a-z0-9_-]\+\|[0-9]\+\):/he=e-1 + +syn keyword crm_head contained order nextgroup=crm_order_id +syn match crm_order_id contained nextgroup=crm_order_score /[ \t]\+\<[a-z0-9_-]\+\>/ +syn match crm_order_score contained nextgroup=crm_order_block /[ \t]\+\(-\?inf\|mandatory\|advisory\|#[a-z0-9_-]\+\|[0-9]\+\):/he=e-1 + +syn match crm_ref contained nextgroup=crm_ref,crm_block /[ \t]\+\<[a-z0-9_-]\+\>/ +syn match crm_ref contained /[ \t]\+\<[a-z0-9_-]\+\>$/ + +syn match crm_order_ref contained /[ \t]\+\<[a-z0-9_-]\+\>\(:\(start\|stop\|promote\|demote\)\)\?/ contains=crm_ops +syn match crm_colo_ref contained /[ \t]\+\<[a-z0-9_-]\+\>\(:\(Slave\|Master\|Started\)\)\?/ contains=crm_roles + +syn match crm_res_id contained /[ \t]\+\<[a-z0-9_-]\+\>/ nextgroup=crm_RA +syn match crm_RA contained /[ \t]\+\<\(ocf:[a-z0-9_-]\+\|heartbeat\|lsb\):[a-z0-9_-]\+\>/ + \ contains=crm_ra_class,crm_ocf_vendor + \ nextgroup=crm_block + +syn match crm_ra_class contained /[ \t]\(ocf\|heartbeat\|lsb\)/ +syn keyword crm_ocf_vendor contained heartbeat pacemaker linbit + +syn keyword crm_key contained attributes params meta op operations date attributes rule +syn keyword crm_roles contained Master Slave Started +syn match crm_nodename contained / [a-z0-9.-]\+\>/ +" crm_ops: match, not keyword, to avoid highlighting it inside attribute names +syn match crm_ops contained /\(start\|stop\|monitor\|promote\|demote\)/ +syn match crm_assign transparent contained + \ /[ \t]\(\$\(id\|role\|id-ref\)\|[a-z0-9_-]\+\)=\("[^"\n]*"\|[^" ]\+\([ \t]\|$\)\)/ms=s+1,me=e-1 + \ contains=crm_attr_name,crm_attr_value +syn match crm_meta_assign transparent contained + \ /[ \t]\(\$\(id\|role\|id-ref\)\|[a-z0-9_-]\+\)=\("[^"\n]*"\|[^" ]\+\([ \t]\|$\)\)/ms=s+1,me=e-1 + \ contains=crm_mattr_name,crm_attr_value +syn match crm_attr_name contained /[^=]\+=/me=e-1 +syn match crm_mattr_name contained /[^=]\+=/me=e-1 contains=crm_m_err +syn match crm_m_err contained /_/ +syn match crm_attr_value contained /=\("[^"\n]*"\|[^" ]\+\)/ms=s+1 + + +if !exists("did_dic_syntax_inits") + "let did_dic_syntax_inits = 1 + hi link crm_container Keyword + hi link crm_head Keyword + hi link crm_key Keyword + hi link crm_id Type + hi link crm_colo_id Type + hi link crm_order_id Type + hi link crm_colo_score Special + hi link crm_order_score Special + hi link crm_ref Identifier + hi link crm_colo_ref Identifier + hi link crm_order_ref Identifier + hi link crm_res_id Identifier + hi link crm_nodename Identifier + hi link crm_attr_name Identifier + hi link crm_mattr_name Identifier + hi link crm_tspace_err Error + hi link crm_m_err Error + hi link crm_attr_value String + hi link crm_RA Function + hi link crm_ra_class keyword + hi link crm_ocf_vendor Type + hi link crm_unexpected Error + hi link crm_ops Special + hi link crm_roles Special +endif + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/contrib/pcmk.vim new/crmsh/contrib/pcmk.vim --- old/crmsh/contrib/pcmk.vim 1970-01-01 01:00:00.000000000 +0100 +++ new/crmsh/contrib/pcmk.vim 2012-09-18 17:40:54.000000000 +0200 @@ -0,0 +1,114 @@ +" Vim syntax file +" Author: Trevor Hemsley <thems...@voiceflex.com> +" Author: Dan Frincu <df.clus...@gmail.com> +" Language: pcmk +" Filenames: *.pcmk + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +set modeline + +" setlocal iskeyword+=- + +" Errors +syn match pcmkParErr ")" +syn match pcmkBrackErr "]" +syn match pcmkBraceErr "}" + +" Enclosing delimiters +syn region pcmkEncl transparent matchgroup=pcmkParEncl start="(" matchgroup=pcmkParEncl end=")" contains=ALLBUT,pcmkParErr +syn region pcmkEncl transparent matchgroup=pcmkBrackEncl start="\[" matchgroup=pcmkBrackEncl end="\]" contains=ALLBUT,pcmkBrackErr +syn region pcmkEncl transparent matchgroup=pcmkBraceEncl start="{" matchgroup=pcmkBraceEncl end="}" contains=ALLBUT,pcmkBraceErr + +" Comments +syn region pcmkComment start="//" end="$" contains=pcmkComment,pcmkTodo +syn region pcmkComment start="/\*" end="\*/" contains=pcmkComment,pcmkTodo +syn keyword pcmkTodo contained TODO FIXME XXX + +" Strings +syn region pcmkString start=+"+ skip=+\\\\\|\\"+ end=+"+ + +" General keywords +syn keyword pcmkKeyword node primitive property rsc_defaults op_defaults group clone nextgroup=pcmkName skipwhite +syn keyword pcmkKey2 location nextgroup=pcmkResource skipwhite +syn keyword pcmkKey3 colocation order nextgroup=pcmkName3 skipwhite +syn match pcmkResource /\<\f\+\>/ nextgroup=pcmkName2 skipwhite +syn match pcmkName /\<\f\+\>/ +syn match pcmkName2 /\<\f\+\>/ nextgroup=pcmkPrio skipwhite +syn match pcmkName3 /\<\f\+\>/ nextgroup=pcmkPrio skipwhite +syn match pcmkPrio /\<\w\+\>/ +syn match pcmkNumbers /[[:digit:]]\+\:/ +syn match pcmkInf /inf\:/ + +" Graph attributes +syn keyword pcmkType attributes params op meta +syn keyword pcmkTag monitor start stop migrate_from migrate_to notify demote promote Master Slave + +" Special chars +"syn match pcmkKeyChar "=" +syn match pcmkKeyChar ";" +syn match pcmkKeyChar "->" +syn match pcmkKeyChar "\$" +"syn match pcmkKeyChar "\\" +syn match pcmkKeyChar ":" +syn match pcmkKeyChar "-" +syn match pcmkKeyChar "+" + +" Identifier +syn match pcmkIdentifier /\<\w\+\>/ +syn match pcmkKeyword "^ms\s*" nextgroup=pcmkName skipwhite + +" Synchronization +syn sync minlines=50 +syn sync maxlines=500 + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_pcmk_syntax_inits") + if version < 508 + let did_pcmk_syntax_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink pcmkParErr Error + HiLink pcmkBraceErr Error + HiLink pcmkBrackErr Error + + HiLink pcmkComment Comment + HiLink pcmkTodo Todo + + HiLink pcmkParEncl Keyword + HiLink pcmkBrackEncl Keyword + HiLink pcmkBraceEncl Keyword + + HiLink pcmkKeyword Keyword + HiLink pcmkKey2 Keyword + HiLink pcmkKey3 Keyword + HiLink pcmkType Keyword + HiLink pcmkKeyChar Keyword + +" hi Normal ctermfg=yellow ctermbg=NONE cterm=NONE + HiLink pcmkString String + HiLink pcmkIdentifier Identifier + HiLink pcmkTag Tag + HiLink pcmkName Type + HiLink pcmkName2 Tag + HiLink pcmkName3 Type + HiLink pcmkResource Type + HiLink pcmkPrio Number + HiLink pcmkNumbers String + HiLink pcmkInf String + + delcommand HiLink +endif + +let b:current_syntax = "pcmk" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/crmsh.spec new/crmsh/crmsh.spec --- old/crmsh/crmsh.spec 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/crmsh.spec 2012-09-18 17:40:54.000000000 +0200 @@ -17,7 +17,7 @@ Name: crmsh Summary: Pacemaker command line interface -Version: 1.1.0 +Version: 1.2.0 Release: %{crmsh_release}%{?dist} License: GPLv2+ Url: http://www.clusterlabs.org @@ -118,6 +118,7 @@ %doc AUTHORS %doc ChangeLog %doc README +%doc contrib %dir %{crmsh_docdir} %dir %attr (770, %{uname}, %{gname}) %{_var}/cache/crm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/doc/crm.8.txt new/crmsh/doc/crm.8.txt --- old/crmsh/doc/crm.8.txt 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/doc/crm.8.txt 2012-09-18 17:40:54.000000000 +0200 @@ -1,6 +1,6 @@ :man source: crm -:man version: 1.1 -:man manual: Pacemaker documentation +:man version: 1.2.0 +:man manual: crmsh documentation crm(8) ====== @@ -16,6 +16,7 @@ *crm* [-D output_type] [-f file] [-H hist_src] [-hFRDw] [--version] [args] +[[topics_Description,Program description]] DESCRIPTION ----------- Pacemaker configuration is stored in a CIB file (Cluster @@ -76,7 +77,7 @@ Print help page. *--version*:: - Print Pacemaker version and build information (Mercurial Hg + Print crmsh version and build information (Mercurial Hg changeset hash). *-R, --regression-tests*:: @@ -87,9 +88,10 @@ Print some debug information. Used by developers. [Not yet refined enough to print useful information for other users.] +[[topics_Introduction,Introduction to the user interface]] == Introduction to the user interface -Arguably the most important aspect of such a program is the user +Arguably the most important aspect of `crm` is the user interface. We begin with an informal introduction so that the reader may get acquainted with it and get a general feeling of the tool. It is probably best just to give some examples: @@ -108,9 +110,7 @@ 3. Cluster configuration: - # crm<<EOF - configure - erase + # crm configure<<EOF # # resources # @@ -165,7 +165,8 @@ are several levels and entering each of them enables the user to use a certain set of commands. -=== Shadow CIB usage +[[topics_Shadows,Shadow CIB usage]] +== Shadow CIB usage Shadow CIB is a normal cluster configuration stored in a file. They may be manipulated in the same way like the _live_ CIB, but @@ -187,11 +188,12 @@ crm(test-2)configure# commit ............... -=== Templates +[[topics_Templates,Configuration templates]] +== Configuration templates -Templates are ready made configurations created by cluster -experts. They are designed in such a way so that users may -generate valid cluster configurations with minimum effort. +Configuration templates are ready made configurations created by +cluster experts. They are designed in such a way so that users +may generate valid cluster configurations with minimum effort. If you are new to Pacemaker, templates may be the best way to start. @@ -343,7 +345,8 @@ - `show`: see if the configuration is valid - `apply`: apply the configuration to the `configure` level -=== Resource testing +[[topics_Testing,Resource testing]] +== Resource testing The amount of detail in a cluster makes all configurations prone to errors. By far the largest number of issues in a cluster is @@ -408,14 +411,15 @@ asymmetric cluster. It is up to the user to specify a list of eligible nodes if a resource is not meant to run on every node. -=== Tab completion +[[topics_Completion,Tab completion]] +== Tab completion -The `crm` makes extensive use of the tab completion of -`readline`. The completion is both static (i.e. for `crm` -commands) and dynamic. The latter takes into account the current -status of the cluster or information from installed resource -agents. Sometimes, completion may also be used to get short help -on resource parameters. Here a few examples: +The `crm` makes extensive use of tab completion. The completion +is both static (i.e. for `crm` commands) and dynamic. The latter +takes into account the current status of the cluster or +information from installed resource agents. Sometimes, completion +may also be used to get short help on resource parameters. Here a +few examples: ............... crm(live)# resource crm(live)resource# <TAB><TAB> @@ -451,8 +455,8 @@ crm(live)configure# primitive fence-1 stonith:ipmilan params auth= ............... -[[SEMCHK]] -=== Configuration semantic checks +[[topics_Checks,Configuration semantic checks]] +== Configuration semantic checks Resource definitions may be checked against the meta-data provided with the resource agents. These checks are currently @@ -482,11 +486,12 @@ `check-mode` to `strict`, errors are not tolerated and such configuration cannot be saved. -=== Access Control Lists (ACL) +[[topics_Security,Access Control Lists (ACL)]] +== Access Control Lists (ACL) -It is desirable to allow users fine grained access to the cluster -and not just ``all or nothing:'' all being the two ultimate power -ids `root` and `hacluster`. +By default, the users from the `haclient` group have full access +to the cluster (or, more precisely, to the CIB). Access control +lists allow for finer access control to the cluster. Access control lists consist of an ordered set of access rules. Each rule allows read or write access or denies access @@ -562,7 +567,8 @@ xpaths simple and the builtin shortcuts should be used whenever possible. -== Reference +[[topics_Reference,Command reference]] +== Command reference We define a small and simple language. Most commands consist of just a list of simple tokens. The only complex constructs are @@ -1250,6 +1256,14 @@ level :: operator | administrator | expert ............... +.Note on security +**************************** +The `skill-level` option is advisory only. There is nothing +stopping any users change their skill level (see +<<topics_Security,Access Control Lists (ACL)>> on how to enforce +access control). +**************************** + [[cmdhelp_options_user,set the cluster user]] ==== `user` @@ -1380,7 +1394,7 @@ not installed at the configuration time set this preference to `never`. -See <<SEMCHK,Configuration semantic checks>> for more details. +See <<topics_Checks,Configuration semantic checks>> for more details. [[cmdhelp_options_check-mode,how to treat semantic errors]] ==== `check-mode` @@ -1390,7 +1404,7 @@ certain problems are treated as configuration errors. In the `relaxed` mode all are treated as warnings. The default is `strict`. -See <<SEMCHK,Configuration semantic checks>> for more details. +See <<topics_Checks,Configuration semantic checks>> for more details. [[cmdhelp_options_show,show current user preference]] ==== `show` @@ -1438,6 +1452,11 @@ - `colocation` - `order` +It is possible to define fencing order (stonith resource +priorities): + +- `fencing_topology` + Finally, there are the cluster properties, resource meta attributes defaults, and operations defaults. All are just a set of attributes. These attributes are managed by the following @@ -2085,6 +2104,7 @@ Examples: ............... filter "sed '/^primitive/s/target-role=[^ ]*//'" + # crm configure filter \"sed \'/^primitive/s/target-role=[^ ]*//\'\" ............... [[cmdhelp_configure_delete,delete CIB objects]] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/cibconfig.py new/crmsh/modules/cibconfig.py --- old/crmsh/modules/cibconfig.py 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/modules/cibconfig.py 2012-09-18 17:40:54.000000000 +0200 @@ -110,6 +110,9 @@ rmlist.append(obj) for obj in rmlist: self.obj_list.remove(obj) + def pre_edit(self, s): + '''Extra processing of the string to be editted''' + return s def edit_save(self,s,erase = False): ''' Save string s to a tmp file. Invoke editor to edit it. @@ -118,6 +121,7 @@ first. If no changes are done, return silently. ''' + s = self.pre_edit(s) tmp = str2tmp(s) if not tmp: return False @@ -336,6 +340,10 @@ return '' return '\n'.join(obj.repr_cli(format = format) \ for obj in processing_sort_cli(self.obj_list)) + def pre_edit(self, s): + '''Extra processing of the string to be editted''' + if user_prefs.editor.startswith("vi"): + return "%s\n#vim:set syntax=pcmk\n" % s def process(self, cli_list, update = False): ''' Create new objects or update existing ones. @@ -1400,6 +1408,8 @@ pass def obj_string(self): return self.obj_id + def match(self,xml_obj_type,obj_id): + return self.xml_obj_type == xml_obj_type def matchcli(self,cli_list): head = cli_list[0] return self.obj_type == head[0] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/cliformat.py new/crmsh/modules/cliformat.py --- old/crmsh/modules/cliformat.py 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/modules/cliformat.py 2012-09-18 17:40:54.000000000 +0200 @@ -24,15 +24,16 @@ # # CLI format generation utilities (from XML) # -def _cli_format(pl,sep,format): +def cli_format(pl,format): if format > 0: return ' \\\n\t'.join(pl) else: - return sep.join(pl) -def cli_format(pl,format): - return _cli_format(pl,' ',format) + return ' '.join(pl) def cli_format_xml(pl,format): - return _cli_format(pl,'',format) + if format > 0: + return ' \\\n'.join(pl) + else: + return ''.join(pl) def cli_operations(node,format = 1): l = [] node_id = node.getAttribute("id") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/help.py.in new/crmsh/modules/help.py.in --- old/crmsh/modules/help.py.in 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/modules/help.py.in 2012-09-18 17:40:54.000000000 +0200 @@ -22,47 +22,88 @@ from vars import Vars from msg import * +# this table needs to match cmd_table of TopLevel in ui.py +init_help_tab = { + "options": ("user preferences", """ +Several user preferences are available. Note that it is possible +to save the preferences to a startup file. +"""), + "cib": ("manage shadow CIBs", """ +A shadow CIB is a regular cluster configuration which is kept in +a file. The CRM and the CRM tools may manage a shadow CIB in the +same way as the live CIB (i.e. the current cluster configuration). +A shadow CIB may be applied to the cluster in one step. +"""), + "resource": ("resources management", """ +Everything related to resources management is available at this +level. Most commands are implemented using the crm_resource(8) +program. +"""), + "node": ("nodes management", """ +A few node related tasks such as node standby are implemented +here. +"""), + "ra": ("resource agents information center", """ +This level contains commands which show various information about +the installed resource agents. It is available both at the top +level and at the `configure` level. +"""), + "configure": ("CRM cluster configuration", """ +The configuration level. + +Note that you can change the working CIB at the cib level. It is +advisable to configure shadow CIBs and then commit them to the +cluster. +"""), + "history": ("CRM cluster history", """ +The history level. + +Examine Pacemaker's history: node and resource events, logs. +"""), + "site": ("Geo-cluster support", """ +The site level. + +Geo-cluster related management. +"""), +} + +def load_init_help_tab(help_tab, levels): + help_tab["."] = ("",""" +This is crm shell, a Pacemaker command line interface. +""") + for lvl in levels: + try: help_tab[lvl] = init_help_tab[lvl] + except: pass + help_tab["status"] = ("show cluster status", """ +Show cluster status. The status is displayed by crm_mon. Supply +additional arguments for more information or different format. +See crm_mon(8) for more details. + +Usage: +............... + status [<option> ...] + + option :: bynode | inactive | ops | timing | failcounts +............... +""") + # # help or make users feel less lonely # -def add_shorthelp(topic,shorthelp,topic_help): +def add_shorthelp(topic,shorthelp,short_tab): ''' Join topics ("%s,%s") if they share the same short description. ''' - for i in range(len(topic_help)): - if topic_help[i][1] == shorthelp: - topic_help[i][0] = "%s,%s" % (topic_help[i][0], topic) + for i in range(len(short_tab)): + if short_tab[i][1] == shorthelp: + short_tab[i][0] = "%s,%s" % (short_tab[i][0], topic) return - topic_help.append([topic, shorthelp]) -def dump_short_help(help_tab): - topic_help = [] - for topic in help_tab: - if topic == '.': - continue - # with odict, for whatever reason, python parses differently: - # help_tab["..."] = ("...","...") and - # help_tab["..."] = ("...",""" - # ...""") - # a parser bug? - if type(help_tab[topic][0]) == type(()): - shorthelp = help_tab[topic][0][0] - else: - shorthelp = help_tab[topic][0] - add_shorthelp(topic,shorthelp,topic_help) - for t,d in topic_help: - print "\t%-16s %s" % (t,d) -def overview(help_tab): - print "" - print help_tab['.'][1] - print "" - print "Available commands:" - print "" - dump_short_help(help_tab) - print "" + short_tab.append([topic, shorthelp]) + def topic_help(help_tab,topic): if topic not in help_tab: - print "There is no help for topic %s" % topic + print "Sorry, could not find any help for %s" % topic return if type(help_tab[topic][0]) == type(()): shorthelp = help_tab[topic][0][0] @@ -74,24 +115,23 @@ page_string(longhelp) else: print shorthelp -def cmd_help(help_tab,topic = ''): - "help!" - # help_tab is an odict (ordered dictionary): - # help_tab[topic] = (short_help,long_help) - # topic '.' is a special entry for the top level - if not help_tab: - common_info("sorry, help not available") - return - if not topic: - overview(help_tab) - else: - topic_help(help_tab,topic) + +def add_static_help(help_tab): + '''Add help items used everywhere''' + help_tab["help"] = ("show help (help topics for list of topics)", """ +The help subsystem consists of the command reference and a list +of topics. The former is what you need in order to get the +details regarding a specific command. The latter should help with +concepts and examples. +""") + help_tab["end"] = ("go back one level", "") + help_tab["quit"] = ("exit the program", "") def is_level(s): return len(s.split("_")) == 2 def help_short(s): - r = re.search("help_[^,]+,(.*)\]\]", s) + r = re.search("_[^,]+,(.*)\]\]", s) return r and r.group(1) or '' class HelpSystem(object): @@ -109,11 +149,52 @@ [[cmdhelp_<level>,<short help text>]] ''' help_text_file = "@datadir@/@PACKAGE@/crm.8.txt" + topics_tok = "topics" def __init__(self): self.key_pos = {} self.leveld = {} self.no_help_file = False # don't print repeatedly messages self.bad_index = False # don't print repeatedly warnings for bad index + def get_short_help(self, help_tab): + short_tab = [] + for topic in help_tab: + if topic == '.': + continue + # with odict, for whatever reason, python parses differently: + # help_tab["..."] = ("...","...") and + # help_tab["..."] = ("...",""" + # ...""") + # a parser bug? + if type(help_tab[topic][0]) == type(()): + shorthelp = help_tab[topic][0][0] + else: + shorthelp = help_tab[topic][0] + add_shorthelp(topic,shorthelp,short_tab) + return short_tab + def overview(self, help_tab): + s = help_tab['.'][1] + # cheating here a bit, but ... + if "crm shell topics" not in help_tab['.'][1]: + s = "%s\nAvailable commands:\n" % s + short_tab = self.get_short_help(help_tab) + l = [s] + for t,d in short_tab: + if self.is_level(t): + t = "%s/" % t + l.append("\t%-16s %s" % (t,d)) + page_string("\n".join(l)) + def cmd_help(self,help_tab,topic = ''): + "help!" + # help_tab is an odict (ordered dictionary): + # help_tab[topic] = (short_help,long_help) + # topic '.' is a special entry for the top level + if not help_tab: + common_info("sorry, help not available") + return + if not topic or topic == "topics": + self.overview(help_tab) + else: + topic_help(help_tab,topic) def open_file(self,name,mode): try: f = open(name,mode) @@ -128,6 +209,7 @@ os.unlink(vars.index_file) self.key_pos = {} self.leveld = {} + self.leveld[self.topics_tok] = [] self.bad_index = True def mk_index(self): ''' @@ -176,6 +258,7 @@ self.mk_index() self.key_pos = {} self.leveld = {} + self.leveld[self.topics_tok] = [] idx_f = self.open_file(vars.index_file,"r") if not idx_f: return False @@ -198,15 +281,19 @@ self.leveld[cur_lvl] = [] else: self.leveld[cur_lvl].append(key) + elif key.startswith("%s_" % self.topics_tok): + self.leveld[self.topics_tok].append(key) self.key_pos[key] = fpos idx_f.close() return True + def is_level(self, s): + return (("cmdhelp_%s" % s) in self.leveld) or (s in init_help_tab) def __filter(self,s): if '<<' in s: return re.sub(r'<<[^,]+,(.+)>>', r'\1', s) else: return s - def __load_help_one(self,key,skip = 2): + def _load_help_one(self,key,skip = 2): longhelp = '' self.help_f.seek(self.key_pos[key]) shorthelp = help_short(self.help_f.readline()) @@ -214,7 +301,7 @@ self.help_f.readline() l = [] for s in self.help_f: - if s.startswith("[[") or s.startswith("="): + if l and (s.startswith("[[") or s.startswith("=")): break l.append(self.__filter(s)) if l and l[-1] == '\n': # drop the last line of empty @@ -234,42 +321,68 @@ common_warn("help topic %s not found" % s) self.drop_index() return None,None - return self.__load_help_one(s) - def __load_level(self,lvl): + return self._load_help_one(s) + def _load_topics(self, help_tab): ''' - For the given level, create a help table. + Get the topic help text. ''' - if wcache.is_cached("lvl_help_tab_%s" % lvl): - return wcache.retrieve("lvl_help_tab_%s" % lvl) - if not self.key_pos and not self.load_index(): - return None - self.help_f = self.open_file(self.help_text_file,"r") - if not self.help_f: + lvl_s = self.topics_tok + if not lvl_s in self.leveld: + if not self.bad_index: + common_warn("help table for topics not found") + self.drop_index() return None + help_tab["."] = ["",""" +List of crm shell topics. +"""] + try: + for key in self.leveld[lvl_s]: + cmd = key[len(lvl_s)+1:] + help_tab[cmd] = self._load_help_one(key, skip=1) + except: pass + def _load_cmd_level(self, lvl, help_tab): + ''' + Get the command help text. + ''' lvl_s = "cmdhelp_%s" % lvl if not lvl_s in self.leveld: if not self.bad_index: common_warn("help table for level %s not found" % lvl) self.drop_index() - return None + return common_debug("loading help table for level %s" % lvl) - help_tab = odict() - help_tab["."] = self.__load_help_one(lvl_s) + help_tab["."] = self._load_help_one(lvl_s) try: for key in self.leveld[lvl_s]: cmd = key[len(lvl_s)+1:] - help_tab[cmd] = self.__load_help_one(key) + help_tab[cmd] = self._load_help_one(key) except: pass + add_static_help(help_tab) + def _load_level(self,lvl): + ''' + For the given level, create a help table. + ''' + if wcache.is_cached("lvl_help_tab_%s" % lvl): + return wcache.retrieve("lvl_help_tab_%s" % lvl) + if not self.key_pos and not self.load_index(): + return None + self.help_f = self.open_file(self.help_text_file,"r") + if not self.help_f: + return None + help_tab = odict() + if lvl == self.topics_tok: + self._load_topics(help_tab) + else: + self._load_cmd_level(lvl, help_tab) self.help_f.close() - help_tab["quit"] = ("exit the program", "") - help_tab["help"] = ("show help", "") - help_tab["end"] = ("go back one level", "") return help_tab def load_level(self,lvl): - help_tab = self.__load_level(lvl) + help_tab = self._load_level(lvl) if self.bad_index: # try again - help_tab = self.__load_level(lvl) + help_tab = self._load_level(lvl) return wcache.store("lvl_help_tab_%s" % lvl, help_tab) + def load_topics(self): + return self.load_level(self.topics_tok) wcache = WCache.getInstance() vars = Vars.getInstance() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/report.py new/crmsh/modules/report.py --- old/crmsh/modules/report.py 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/modules/report.py 2012-09-18 17:40:54.000000000 +0200 @@ -83,6 +83,8 @@ while True: pos = f.tell() s = f.readline() + if not s: + break curr_ts = syslog_ts(s) if (to_end and curr_ts > ts) or \ (not to_end and curr_ts >= ts): @@ -416,7 +418,7 @@ archive = '%s.tar.bz2' % os.path.join(home, os.path.basename(dir)) cmd = "tar -C '%s/..' -cj -f '%s' %s" % \ (dir, archive, os.path.basename(dir)) - if ext_cmd_nosudo(cmd) != 0: + if pipe_cmd_nosudo(cmd) != 0: common_err('could not pack report, command "%s" failed' % cmd) return False else: @@ -508,7 +510,7 @@ common_err("%s: %s" % (tarball, msg)) return None common_debug("tar -x%s < %s" % (tar_unpack_option,bfname)) - rc = ext_cmd_nosudo("tar -x%s < %s" % (tar_unpack_option,bfname)) + rc = pipe_cmd_nosudo("tar -x%s < %s" % (tar_unpack_option,bfname)) if self.source == "live": os.remove(bfname) os.chdir(cwd) @@ -608,7 +610,7 @@ if not fl: continue u_dir = os.path.join(self.loc, node) - rc = ext_cmd_nosudo("tar -C %s -x < %s" % (u_dir,fl[0])) + rc = pipe_cmd_nosudo("tar -C %s -x < %s" % (u_dir,fl[0])) def find_new_peinputs(self, node_l): ''' Get a list of pe inputs appearing in new logs. @@ -704,10 +706,10 @@ nodes_option = "" if self.setnodes: nodes_option = "'-n %s'" % ' '.join(self.setnodes) - if ext_cmd_nosudo("mkdir -p %s" % os.path.dirname(d)) != 0: + if pipe_cmd_nosudo("mkdir -p %s" % os.path.dirname(d)) != 0: return None common_info("retrieving information from cluster nodes, please wait ...") - rc = ext_cmd_nosudo("hb_report -Z -f '%s' %s %s %s" % + rc = pipe_cmd_nosudo("hb_report -Z -f '%s' %s %s %s" % (self.from_dt.ctime(), to_option, nodes_option, d)) if rc != 0: if os.path.isfile(tarball): @@ -1193,10 +1195,10 @@ common_err("history session %s does not exist" % name) return False if subcmd == "save": - if ext_cmd_nosudo("mkdir -p %s" % dir) != 0: + if pipe_cmd_nosudo("mkdir -p %s" % dir) != 0: return False if self.source == "live": - rc = ext_cmd_nosudo("tar -C '%s' -c . | tar -C '%s' -x" % \ + rc = pipe_cmd_nosudo("tar -C '%s' -c . | tar -C '%s' -x" % \ (self._live_loc(), dir)) if rc != 0: return False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/ui.py.in new/crmsh/modules/ui.py.in --- old/crmsh/modules/ui.py.in 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/modules/ui.py.in 2012-09-18 17:40:54.000000000 +0200 @@ -22,7 +22,7 @@ import time import bz2 -from help import HelpSystem, cmd_help +from help import HelpSystem, load_init_help_tab, add_static_help from vars import Vars from levels import Levels from cibconfig import mkset_obj, CibFactory @@ -60,6 +60,7 @@ global_cmd_aliases = { "quit": ("bye","exit"), "end": ("cd","up"), + "help": ("?"), } def __init__(self): self.help_table = odict() @@ -71,6 +72,7 @@ self.cmd_aliases = self.global_cmd_aliases.copy() if options.interactive: self.help_table = help_sys.load_level(self.lvl_name) + self.topics = [] def end_game(self, no_questions_asked = False): pass def should_wait(self): @@ -81,11 +83,19 @@ ''' return False def help(self,cmd,topic = ''): - "usage: help [<topic>]" - if not self.help_table: - self.help_table = help_sys.load_level(self.lvl_name) - setup_help_aliases(self) - cmd_help(self.help_table,topic) + "usage: help [<command>|<Topic>|topics]" + if topic in ("?","Help","HELP","HELP!"): + topic = "help" + if topic == "topics" or (topic and topic[0].isupper()): + if not self.topics: + self.topics = help_sys.load_topics() + help_tab = self.topics + else: + if not self.help_table: + self.help_table = help_sys.load_level(self.lvl_name) + setup_help_aliases(self) + help_tab = self.help_table + help_sys.cmd_help(help_tab,topic) def end(self,cmd,dir = ".."): "usage: end" self.end_game() @@ -100,11 +110,6 @@ Manage user preferences ''' lvl_name = "options" - desc_short = "user preferences" - desc_long = """ -Several user preferences are available. Note that it is possible -to save the preferences to a startup file. -""" def __init__(self): UserInterface.__init__(self) self.cmd_table["skill-level"] = (self.set_skill_level,(1,1),0,0) @@ -172,13 +177,6 @@ CIB shadow management class ''' lvl_name = "cib" - desc_short = "manage shadow CIBs" - desc_long = """ -A shadow CIB is a regular cluster configuration which is kept in -a file. The CRM and the CRM tools may manage a shadow CIB in the -same way as the live CIB (i.e. the current cluster configuration). -A shadow CIB may be applied to the cluster in one step. -""" extcmd = ">/dev/null </dev/null crm_shadow" extcmd_stdout = "</dev/null crm_shadow" def __init__(self): @@ -746,12 +744,6 @@ Resources management class ''' lvl_name = "resource" - desc_short = "resources management" - desc_long = """ -Everything related to resources management is available at this -level. Most commands are implemented using the crm_resource(8) -program. -""" rsc_status_all = "crm_resource -L" rsc_status = "crm_resource -W -r '%s'" rsc_showxml = "crm_resource -q -r '%s'" @@ -1006,11 +998,6 @@ Nodes management class ''' lvl_name = "node" - desc_short = "nodes management" - desc_long = """ -A few node related tasks such as node standby are implemented -here. -""" node_standby = "crm_attribute -N '%s' -n standby -v '%s' %s" node_delete = "cibadmin -D -o nodes -X '<node uname=\"%s\"/>'" node_delete_status = "cibadmin -D -o status -X '<node_state uname=\"%s\"/>'" @@ -1217,12 +1204,6 @@ CIB shadow management class ''' lvl_name = "ra" - desc_short = "resource agents information center" - desc_long = """ -This level contains commands which show various information about -the installed resource agents. It is available both at the top -level and at the `configure` level. -""" provider_classes = ["ocf"] def __init__(self): UserInterface.__init__(self) @@ -1383,14 +1364,6 @@ The configuration class ''' lvl_name = "configure" - desc_short = "CRM cluster configuration" - desc_long = """ -The configuration level. - -Note that you can change the working CIB at the cib level. It is -advisable to configure shadow CIBs and then commit them to the -cluster. -""" def __init__(self): UserInterface.__init__(self) self.cmd_table["erase"] = (self.erase,(0,1),1,0) @@ -1768,12 +1741,6 @@ The history class ''' lvl_name = "history" - desc_short = "CRM cluster history" - desc_long = """ -The history level. - -Examine Pacemaker's history: node and resource events, logs. -""" def __init__(self): UserInterface.__init__(self) self.cmd_table["source"] = (self.source,(1,1),1,0) @@ -2035,12 +2002,6 @@ The site class ''' lvl_name = "site" - desc_short = "Geo-cluster support" - desc_long = """ -The site level. - -Geo-cluster related management. -""" crm_ticket = { 'grant': "crm_ticket -t '%s' -g", 'revoke': "crm_ticket -t '%s' -r", @@ -2112,26 +2073,8 @@ self.cmd_table['status'] = (self.status,(0,5),0,0) self.cmd_table['ra'] = RA setup_aliases(self) - self.help_table["."] = ("","""This is the CRM command line interface program.""") - for lvl in self.cmd_table.keys(): - try: self.help_table[lvl] = (self.cmd_table[lvl].desc_short, \ - self.cmd_table[lvl].desc_long) - except: pass - self.help_table["status"] = ("show cluster status", """ -Show cluster status. The status is displayed by crm_mon. Supply -additional arguments for more information or different format. -See crm_mon(8) for more details. - -Usage: -............... - status [<option> ...] - - option :: bynode | inactive | ops | timing | failcounts -............... -""") - self.help_table["quit"] = ("exit the program", "") - self.help_table["help"] = ("show help", "") - self.help_table["end"] = ("go back one level", "") + load_init_help_tab(self.help_table, self.cmd_table.keys()) + add_static_help(self.help_table) setup_help_aliases(self) def status(self,cmd,*args): """usage: status [<option> ...] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/userprefs.py new/crmsh/modules/userprefs.py --- old/crmsh/modules/userprefs.py 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/modules/userprefs.py 2012-09-18 17:40:54.000000000 +0200 @@ -61,6 +61,7 @@ self.editor = find_program("EDITOR","vim","vi","emacs","nano") self.pager = find_program("PAGER","less","more","pg") self.dotty = find_program("","dotty") + self.ptest = find_program("","ptest","crm_simulate") if not self.editor: self.missing("editor") if not self.pager: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh/modules/utils.py new/crmsh/modules/utils.py --- old/crmsh/modules/utils.py 2012-08-29 14:56:25.000000000 +0200 +++ new/crmsh/modules/utils.py 2012-09-18 17:40:54.000000000 +0200 @@ -152,6 +152,7 @@ if not ("Broken pipe" in msg): common_err(msg) return rc + def filter_string(cmd,s,stderr_on = True): rc = -1 # command failed if stderr_on: @@ -175,7 +176,7 @@ Write the given string to a temporary file. Return the name of the file. ''' - fd,tmp = mkstemp() + fd,tmp = mkstemp(suffix=".pcmk") try: f = os.fdopen(fd,"w") except IOError, msg: common_err(msg) @@ -242,6 +243,10 @@ if options.regression_tests: print ".EXT", cmd return subprocess.call(add_sudo(cmd), shell=True) +def ext_cmd_nosudo(cmd): + if options.regression_tests: + print ".EXT", cmd + return subprocess.call(cmd, shell=True) def rmdir_r(d): if d and os.path.isdir(d): @@ -284,12 +289,7 @@ def release_lock(dir): rmdir_r(os.path.join(dir,_LOCKDIR)) -#def ext_cmd_nosudo(cmd): -# if options.regression_tests: -# print ".EXT", cmd -# return subprocess.call(cmd, shell=True) - -def ext_cmd_nosudo(cmd): +def pipe_cmd_nosudo(cmd): if options.regression_tests: print ".EXT", cmd proc = subprocess.Popen(cmd, shell = True, @@ -408,7 +408,7 @@ Pipe graph_s thru ptest(8). Show graph using dotty if requested. ''' actions_filter = "grep LogActions: | grep -vw Leave" - ptest = "2>&1 ptest -x -" + ptest = "2>&1 %s -x -" % user_prefs.ptest if verbosity: if actions: verbosity = 'v' * max(3,len(verbosity)) @@ -568,7 +568,7 @@ return if not user_prefs.editor: return - return ext_cmd("%s %s" % (user_prefs.editor,fname)) + return ext_cmd_nosudo("%s %s" % (user_prefs.editor,fname)) def need_pager(s, w, h): from math import ceil -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org