commit crmsh for openSUSE:Factory
Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2018-03-29 11:57:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "crmsh" Thu Mar 29 11:57:58 2018 rev:143 rq:592143 version:4.0.0+git.1522278003.cd7ae188 Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2018-02-27 17:00:16.599015133 +0100 +++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2018-03-29 11:58:06.188975738 +0200 @@ -1,0 +2,6 @@ +Wed Mar 28 23:00:23 UTC 2018 - kgronlund@suse.com + +- Update to version 4.0.0+git.1522278003.cd7ae188: + * high: ui_resource: Undeprecate refresh and remove reprobe (bsc#1084736) + +------------------------------------------------------------------- Old: ---- crmsh-4.0.0+git.1519721966.9abd841c.tar.bz2 New: ---- crmsh-4.0.0+git.1522278003.cd7ae188.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.B5n5f0/_old 2018-03-29 11:58:08.912877430 +0200 +++ /var/tmp/diff_new_pack.B5n5f0/_new 2018-03-29 11:58:08.916877286 +0200 @@ -36,7 +36,7 @@ Summary: High Availability cluster command-line interface License: GPL-2.0-or-later Group: %{pkg_group} -Version: 4.0.0+git.1519721966.9abd841c +Version: 4.0.0+git.1522278003.cd7ae188 Release: 0 Url: http://crmsh.github.io Source0: %{name}-%{version}.tar.bz2 ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.B5n5f0/_old 2018-03-29 11:58:08.956875842 +0200 +++ /var/tmp/diff_new_pack.B5n5f0/_new 2018-03-29 11:58:08.956875842 +0200 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/ClusterLabs/crmsh.git</param> - <param name="changesrevision">9abd841ca08a609923c8406584a112900bb27262</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">7686d0078edae58e16cf29ffdf38210e9cac37f3</param></service></servicedata> \ No newline at end of file ++++++ crmsh-4.0.0+git.1519721966.9abd841c.tar.bz2 -> crmsh-4.0.0+git.1522278003.cd7ae188.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/.vscode/settings.json new/crmsh-4.0.0+git.1522278003.cd7ae188/.vscode/settings.json --- old/crmsh-4.0.0+git.1519721966.9abd841c/.vscode/settings.json 1970-01-01 01:00:00.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/.vscode/settings.json 2018-03-29 01:00:03.000000000 +0200 @@ -0,0 +1,6 @@ +{ + "python.linting.pylintEnabled": true, + "python.linting.flake8Enabled": false, + "python.linting.enabled": true, + "python.pythonPath": "/usr/bin/python3" +} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/AUTHORS new/crmsh-4.0.0+git.1522278003.cd7ae188/AUTHORS --- old/crmsh-4.0.0+git.1519721966.9abd841c/AUTHORS 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/AUTHORS 2018-03-29 01:00:03.000000000 +0200 @@ -5,10 +5,13 @@ Adam Spiers <aspiers[at]suse[dot]com> Andrei Maruha <Andrei_Maruha[at]epam[dot]com> Andrew Beekhof <andrew[at]beekhof[dot]net> + Bin Liu <bliu[at]suse[dot]com> Borislav Borisov <borislav[dot]v[dot]borisov[at]gmail[dot]com> Christian Seiler <christian[at]iwakd[dot]de> Daniel Hoffend <dh[at]dotlan[dot]net> Dejan Muhamedagic <dejan[at]suse[dot]de> + dougcahill <doug[dot]cahill[at]actifio[dot]com> + Eric Ren <zren[at]suse[dot]com> Federica Teodori <federica[dot]teodori[at]googlemail[dot]com> Florian Haas <florian[dot]haas[at]linbit[dot]com> Goldwyn Rodrigues <rgoldwyn[at]novell[dot]com> @@ -29,6 +32,7 @@ Nate Clark <nate[at]neworld[dot]us> nozawat <nozawat[at]gmail[dot]com> Pedro Salgado <steenzout[at]saucelabs[dot]com> + Peter Schwindt <peter[at]schwindt-net[dot]de> Richard B Winters <rik[at]mmogp[dot]com> seabres <rainer[dot]brestan[at]gmx[dot]net> Tim Serong <tserong[at]suse[dot]com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/crmsh/bootstrap.py new/crmsh-4.0.0+git.1522278003.cd7ae188/crmsh/bootstrap.py --- old/crmsh-4.0.0+git.1519721966.9abd841c/crmsh/bootstrap.py 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/crmsh/bootstrap.py 2018-03-29 01:00:03.000000000 +0200 @@ -1799,17 +1799,18 @@ if nodelist is None: for v in corosync.get_values("quorum.expected_votes"): expected_votes = v - #for node >= 2, expected_votes = nodecount + device_votes - #asume nodecount is N, for ffsplit, qdevice only has one vote - #which means that device_votes is 1, ie:expected_votes = N + 1; - #while for lms, qdevice has N - 1 votes, ie: expected_votes = N + (N - 1) - #and update quorum.device.net.algorithm based on device_votes + + # For node >= 2, expected_votes = nodecount + device_votes + # Assume nodecount is N, for ffsplit, qdevice only has one vote + # which means that device_votes is 1, ie:expected_votes = N + 1; + # while for lms, qdevice has N - 1 votes, ie: expected_votes = N + (N - 1) + # and update quorum.device.net.algorithm based on device_votes if corosync.get_value("quorum.device.net.algorithm") == "lms": device_votes = int((expected_votes - 1) / 2) nodecount = expected_votes - device_votes - #as nodecount will increase 1, and device_votes is nodecount - 1 - #device_votes also increase 1 + # as nodecount will increase 1, and device_votes is nodecount - 1 + # device_votes also increase 1 device_votes += 1 elif corosync.get_value("quorum.device.net.algorithm") == "ffsplit": device_votes = 1 @@ -1824,10 +1825,10 @@ else: nodecount = len(nodelist) expected_votes = 0 - #for node >= 2, expected_votes = nodecount + device_votes - #asume nodecount is N, for ffsplit, qdevice only has one vote - #which means that device_votes is 1, ie:expected_votes = N + 1; - #while for lms, qdevice has N - 1 votes, ie: expected_votes = N + (N - 1) + # For node >= 2, expected_votes = nodecount + device_votes + # Assume nodecount is N, for ffsplit, qdevice only has one vote + # which means that device_votes is 1, ie:expected_votes = N + 1; + # while for lms, qdevice has N - 1 votes, ie: expected_votes = N + (N - 1) if corosync.get_value("quorum.device.net.algorithm") == "ffsplit": device_votes = 1 if corosync.get_value("quorum.device.net.algorithm") == "lms": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/crmsh/cache.py new/crmsh-4.0.0+git.1522278003.cd7ae188/crmsh/cache.py --- old/crmsh-4.0.0+git.1519721966.9abd841c/crmsh/cache.py 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/crmsh/cache.py 2018-03-29 01:00:03.000000000 +0200 @@ -1,17 +1,20 @@ # Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de> +# Copyright (C) 2018 Kristoffer Gronlund <kgronlund@suse.com> # See COPYING for license information. # # Cache stuff. A naive implementation. +# Used by ra.py to cache named lists of things. import time -_max_cache_age = 600 # seconds +_max_cache_age = 600.0 # seconds _stamp = time.time() _lists = {} def _clear(): + "Clear the cache." global _stamp global _lists _stamp = time.time() @@ -19,20 +22,26 @@ def is_cached(name): - if time.time() - _stamp > _max_cache_age: - _clear() - return name in _lists + "True if the argument exists in the cache." + return retrieve(name) is not None def store(name, lst): + """ + Stores the given list for the given name. + Returns the given list. + """ _lists[name] = lst return lst def retrieve(name): - if is_cached(name): - return _lists[name] - return None + """ + Returns the cached list for name, or None. + """ + if time.time() - _stamp > _max_cache_age: + _clear() + return _lists.get(name) # vim:ts=4:sw=4:et: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/crmsh/ui_resource.py new/crmsh-4.0.0+git.1522278003.cd7ae188/crmsh/ui_resource.py --- old/crmsh-4.0.0+git.1519721966.9abd841c/crmsh/ui_resource.py 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/crmsh/ui_resource.py 2018-03-29 01:00:03.000000000 +0200 @@ -1,5 +1,5 @@ # Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de> -# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com> +# Copyright (C) 2013-2018 Kristoffer Gronlund <kgronlund@suse.com> # See COPYING for license information. from . import command @@ -150,17 +150,6 @@ return True -def cleanup_resource(rsc, node='', force=False): - if not utils.is_name_sane(rsc) or not utils.is_name_sane(node): - return False - forces = " -f" if force else "" - if not node: - rc = utils.ext_cmd((RscMgmt.rsc_cleanup_all % (rsc)) + forces) == 0 - else: - rc = utils.ext_cmd((RscMgmt.rsc_cleanup % (rsc, node)) + forces) == 0 - return rc - - _attrcmds = compl.choice(['delete', 'set', 'show']) _raoperations = compl.choice(constants.ra_operations) @@ -171,27 +160,25 @@ ''' name = "resource" - rsc_status_all = "crm_resource -L" - rsc_status = "crm_resource --locate -r '%s'" - rsc_showxml = "crm_resource -q -r '%s'" - rsc_setrole = "crm_resource --meta -r '%s' -p target-role -v '%s'" - rsc_migrate = "crm_resource --quiet --move -r '%s' %s" - rsc_unmigrate = "crm_resource --quiet --clear -r '%s'" - rsc_ban = "crm_resource --ban -r '%s' %s" - rsc_cleanup = "crm_resource -C -r '%s' -H '%s'" - rsc_cleanup_all = "crm_resource -C -r '%s'" - rsc_maintenance = "crm_resource -r '%s' --meta -p maintenance -v '%s'" + rsc_status_all = "crm_resource --list" + rsc_status = "crm_resource --locate --resource '%s'" + rsc_showxml = "crm_resource --query-xml --resource '%s'" + rsc_setrole = "crm_resource --meta --resource '%s' --set-parameter target-role --parameter-value '%s'" + rsc_migrate = "crm_resource --quiet --move --resource '%s' %s" + rsc_unmigrate = "crm_resource --quiet --clear --resource '%s'" + rsc_ban = "crm_resource --ban --resource '%s' %s" + rsc_maintenance = "crm_resource --resource '%s' --meta --set-parameter maintenance --parameter-value '%s'" rsc_param = { - 'set': "crm_resource -r '%s' -p '%s' -v '%s'", - 'delete': "crm_resource -r '%s' -d '%s'", - 'show': "crm_resource -r '%s' -g '%s'", - 'get': "crm_resource -r '%s' -g '%s'", + 'set': "crm_resource --resource '%s' --set-parameter '%s' --parameter-value '%s'", + 'delete': "crm_resource --resource '%s' --delete-parameter '%s'", + 'show': "crm_resource --resource '%s' --get-parameter '%s'", + 'get': "crm_resource --resource '%s' --get-parameter '%s'", } rsc_meta = { - 'set': "crm_resource --meta -r '%s' -p '%s' -v '%s'", - 'delete': "crm_resource --meta -r '%s' -d '%s'", - 'show': "crm_resource --meta -r '%s' -g '%s'", - 'get': "crm_resource --meta -r '%s' -g '%s'", + 'set': "crm_resource --meta --resource '%s' --set-parameter '%s' --parameter-value '%s'", + 'delete': "crm_resource --meta --resource '%s' --delete-parameter '%s'", + 'show': "crm_resource --meta --resource '%s' --get-parameter '%s'", + 'get': "crm_resource --meta --resource '%s' --get-parameter '%s'", } rsc_failcount = { 'set': "crm_attribute -t status -n 'fail-count-%s' -N '%s' -v '%s' -d 0", @@ -200,10 +187,10 @@ 'get': "crm_failcount -G -r %s -N %s", } rsc_utilization = { - 'set': "crm_resource -z -r '%s' -p '%s' -v '%s'", - 'delete': "crm_resource -z -r '%s' -d '%s'", - 'show': "crm_resource -z -r '%s' -g '%s'", - 'get': "crm_resource -z -r '%s' -g '%s'", + 'set': "crm_resource --utilization --resource '%s' --set-parameter '%s' --parameter-value '%s'", + 'delete': "crm_resource --utilization --resource '%s' --delete-parameter '%s'", + 'show': "crm_resource --utilization --resource '%s' --get-parameter '%s'", + 'get': "crm_resource --utilization --resource '%s' --get-parameter '%s'", } rsc_secret = { 'set': "cibsecret set '%s' '%s' '%s'", @@ -214,10 +201,31 @@ 'get': "cibsecret get '%s' '%s'", 'check': "cibsecret check '%s' '%s'", } - rsc_refresh = "crm_resource -C" - rsc_refresh_node = "crm_resource -C -H '%s'" - rsc_reprobe = "crm_resource -C" - rsc_reprobe_node = "crm_resource -C -H '%s'" + + def _refresh_cleanup(self, action, rsc, node, force): + """ + Implements the refresh and cleanup commands. + """ + if rsc == "force": + rsc = None + force = True + if node == "force": + node = None + force = True + cmd = ["crm_resource", "--" + action] + if rsc: + if not utils.is_name_sane(rsc): + return False + cmd.append("--resource") + cmd.append(rsc) + if node: + if not utils.is_name_sane(node): + return False + cmd.append("--node") + cmd.append(node) + if force: + cmd.append("--force") + return utils.ext_cmd(" ".join(cmd)) == 0 def requires(self): for program in ('crm_resource', 'crm_attribute'): @@ -373,9 +381,9 @@ opts = '' if node: - opts = "--node='%s'" % node + opts = "--node '%s'" % node if lifetime: - opts = "%s --lifetime='%s'" % (opts, lifetime) + opts = "%s --lifetime '%s'" % (opts, lifetime) if force or config.core.force: opts = "%s --force" % opts rc = utils.ext_cmd(self.rsc_migrate % (rsc, opts)) @@ -403,9 +411,9 @@ context.fatal_error("Not our node: " + node) opts = '' if node: - opts = "--node='%s'" % node + opts = "--node '%s'" % node if lifetime: - opts = "%s --lifetime='%s'" % (opts, lifetime) + opts = "%s --lifetime '%s'" % (opts, lifetime) if force: opts = "%s --force" % opts rc = utils.ext_cmd(self.rsc_ban % (rsc, opts)) @@ -432,14 +440,9 @@ @command.skill_level('administrator') @command.wait @command.completers(compl.resources, compl.nodes) - def do_cleanup(self, context, resource, *args): - "usage: cleanup <rsc> [<node>] [force]" - # Cleanup a resource on a node. Omit node to cleanup on - # all live nodes. - argl = list(args) - force = "force" in utils.fetch_opts(argl, ["force"]) or config.core.force - node = argl[0] if len(argl) > 0 else '' - return cleanup_resource(resource, node, force=force) + def do_cleanup(self, context, rsc=None, node=None, force=False): + "usage: cleanup [<rsc>] [<node>] [force]" + return self._refresh_cleanup("cleanup", rsc, node, force) @command.wait @command.completers(compl.resources, compl.nodes) @@ -515,26 +518,11 @@ return ui_utils.manage_attr(context.get_command_name(), self.rsc_utilization, rsc, cmd, attr, value) + @command.alias('reprobe') @command.completers(compl.nodes) - def do_refresh(self, context, *args): - 'usage: refresh [<node>]' - if len(args) == 1: - if not utils.is_name_sane(args[0]): - return False - return utils.ext_cmd(self.rsc_refresh_node % args[0]) == 0 - else: - return utils.ext_cmd(self.rsc_refresh) == 0 - - @command.wait - @command.completers(compl.nodes) - def do_reprobe(self, context, *args): - 'usage: reprobe [<node>]' - if len(args) == 1: - if not utils.is_name_sane(args[0]): - return False - return utils.ext_cmd(self.rsc_reprobe_node % args[0]) == 0 - else: - return utils.ext_cmd(self.rsc_reprobe) == 0 + def do_refresh(self, context, rsc=None, node=None, force=False): + 'usage: refresh [<rsc>] [<node>] [force]' + return self._refresh_cleanup("refresh", rsc, node, force) @command.wait @command.completers(compl.resources, compl.choice(['on', 'off', 'true', 'false'])) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/doc/crm.8.adoc new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/crm.8.adoc --- old/crmsh-4.0.0+git.1519721966.9abd841c/doc/crm.8.adoc 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/crm.8.adoc 2018-03-29 01:00:03.000000000 +0200 @@ -217,7 +217,7 @@ cleanup list promote start up demote manage quit status utilization end meta refresh stop -exit migrate reprobe unmanage +exit migrate unmanage crm(live)configure# primitive fence-1 <TAB><TAB> heartbeat: lsb: ocf: stonith: @@ -1947,9 +1947,11 @@ [[cmdhelp_resource_cleanup,cleanup resource status]] ==== `cleanup` -Cleanup resource status. Typically done after the resource has -temporarily failed. If a node is omitted, cleanup on all nodes. -If there are many nodes, the command may take a while. +If resource has any past failures, clear its history and fail +count. Typically done after the resource has temporarily +failed. + +If a node is omitted, cleanup on all nodes. +(Pacemaker 1.1.14)+ Pass force to cleanup the resource itself, otherwise the cleanup command will apply to the parent resource (if @@ -1957,7 +1959,7 @@ Usage: ............... -cleanup <rsc> [<node>] [force] +cleanup [<rsc>] [<node>] [force] ............... [[cmdhelp_resource_clear,Clear any relocation constraint]] @@ -2126,36 +2128,14 @@ promote <rsc> ............... -[[cmdhelp_resource_refresh,refresh CIB from the LRM status]] +[[cmdhelp_resource_refresh,Recheck current resource status and drop failure history]] ==== `refresh` -Refresh CIB from the LRM status. - -.Note -**************************** -`refresh` has been deprecated and is now -an alias for `cleanup`. -**************************** - -Usage: -............... -refresh [<node>] -............... - -[[cmdhelp_resource_reprobe,probe for resources not started by the CRM]] -==== `reprobe` - -Probe for resources not started by the CRM. - -.Note -**************************** -`reprobe` has been deprecated and is now -an alias for `cleanup`. -**************************** +Delete resource's history (including failures) so its current state is rechecked. Usage: ............... -reprobe [<node>] +refresh [<rsc>] [<node>] [force] ............... [[cmdhelp_resource_restart,restart resources]] @@ -3423,7 +3403,7 @@ `group` can be passed the "container" meta attribute, to indicate that it is to be used to group VM resources monitored using Nagios. The resource referred to by the container attribute must be of type -`ocf:heartbeat:Xen`, `oxf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. +`ocf:heartbeat:Xen`, `ocf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. Usage: ............... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/doc/website-v1/man-1.2.adoc new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/website-v1/man-1.2.adoc --- old/crmsh-4.0.0+git.1519721966.9abd841c/doc/website-v1/man-1.2.adoc 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/website-v1/man-1.2.adoc 2018-03-29 01:00:03.000000000 +0200 @@ -1758,7 +1758,7 @@ `group` can be passed the "container" meta attribute, to indicate that it is to be used to group VM resources monitored using Nagios. The resource referred to by the container attribute must be of type -`ocf:heartbeat:Xen`, `oxf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. +`ocf:heartbeat:Xen`, `ocf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. Usage: ............... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/doc/website-v1/man-2.0.adoc new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/website-v1/man-2.0.adoc --- old/crmsh-4.0.0+git.1519721966.9abd841c/doc/website-v1/man-2.0.adoc 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/website-v1/man-2.0.adoc 2018-03-29 01:00:03.000000000 +0200 @@ -3064,7 +3064,7 @@ `group` can be passed the "container" meta attribute, to indicate that it is to be used to group VM resources monitored using Nagios. The resource referred to by the container attribute must be of type -`ocf:heartbeat:Xen`, `oxf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. +`ocf:heartbeat:Xen`, `ocf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. Usage: ............... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/doc/website-v1/man-3.adoc new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/website-v1/man-3.adoc --- old/crmsh-4.0.0+git.1519721966.9abd841c/doc/website-v1/man-3.adoc 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/doc/website-v1/man-3.adoc 2018-03-29 01:00:03.000000000 +0200 @@ -3325,7 +3325,7 @@ `group` can be passed the "container" meta attribute, to indicate that it is to be used to group VM resources monitored using Nagios. The resource referred to by the container attribute must be of type -`ocf:heartbeat:Xen`, `oxf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. +`ocf:heartbeat:Xen`, `ocf:heartbeat:VirtualDomain` or `ocf:heartbeat:lxc`. Usage: ............... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/test/testcases/resource new/crmsh-4.0.0+git.1522278003.cd7ae188/test/testcases/resource --- old/crmsh-4.0.0+git.1519721966.9abd841c/test/testcases/resource 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/test/testcases/resource 2018-03-29 01:00:03.000000000 +0200 @@ -40,10 +40,24 @@ resource start cg resource stop cg resource stop p3 +%setenv showobj= configure rename p3 p4 configure primitive p3 Dummy resource stop p3 -%setenv showobj= +resource start p3 +resource cleanup +resource cleanup p3 +resource cleanup p3 node1 +resource cleanup force +resource cleanup p3 force +resource cleanup p3 node1 force +resource refresh +resource refresh p3 +resource refresh p3 node1 +resource refresh force +resource refresh p3 force +resource refresh p3 node1 force +resource stop p3 configure rm cg configure ms msg g resource scores diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/test/testcases/resource.exp new/crmsh-4.0.0+git.1522278003.cd7ae188/test/testcases/resource.exp --- old/crmsh-4.0.0+git.1519721966.9abd841c/test/testcases/resource.exp 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/test/testcases/resource.exp 2018-03-29 01:00:03.000000000 +0200 @@ -1,5 +1,5 @@ .TRY resource status p0 -.EXT crm_resource --locate -r 'p0' +.EXT crm_resource --locate --resource 'p0' resource p0 is NOT running .SETENV showobj=p3 .TRY resource start p3 @@ -87,7 +87,7 @@ .SETENV showobj=cli-prefer-p3 .TRY resource migrate p3 node1 -.EXT crm_resource --quiet --move -r 'p3' --node='node1' +.EXT crm_resource --quiet --move --resource 'p3' --node 'node1' INFO: Move constraint created for p3 to node1 .INP: configure .INP: _regtest on @@ -106,11 +106,11 @@ .SETENV showobj= .TRY resource unmigrate p3 -.EXT crm_resource --quiet --clear -r 'p3' +.EXT crm_resource --quiet --clear --resource 'p3' INFO: Removed migration constraints for p3 .SETENV showobj=cli-prefer-p3 .TRY resource migrate p3 node1 force -.EXT crm_resource --quiet --move -r 'p3' --node='node1' --force +.EXT crm_resource --quiet --move --resource 'p3' --node 'node1' --force INFO: Move constraint created for p3 to node1 .INP: configure .INP: _regtest on @@ -129,11 +129,11 @@ .SETENV showobj= .TRY resource unmigrate p3 -.EXT crm_resource --quiet --clear -r 'p3' +.EXT crm_resource --quiet --clear --resource 'p3' INFO: Removed migration constraints for p3 .SETENV showobj=p0 .TRY resource param p0 set a0 "1 2 3" -.EXT crm_resource -r 'p0' -p 'a0' -v '1 2 3' +.EXT crm_resource --resource 'p0' --set-parameter 'a0' --parameter-value '1 2 3' Set 'p0' option: id=p0-instance_attributes-a0 set=p0-instance_attributes name=a0=1 2 3 .INP: configure @@ -156,7 +156,7 @@ </cib> .TRY resource param p0 show a0 -.EXT crm_resource -r 'p0' -g 'a0' +.EXT crm_resource --resource 'p0' --get-parameter 'a0' 1 2 3 .INP: configure .INP: _regtest on @@ -178,7 +178,7 @@ </cib> .TRY resource param p0 delete a0 -.EXT crm_resource -r 'p0' -d 'a0' +.EXT crm_resource --resource 'p0' --delete-parameter 'a0' Deleted 'p0' option: id=p0-instance_attributes-a0 name=a0 .INP: configure .INP: _regtest on @@ -198,7 +198,7 @@ </cib> .TRY resource meta p0 set m0 123 -.EXT crm_resource --meta -r 'p0' -p 'm0' -v '123' +.EXT crm_resource --meta --resource 'p0' --set-parameter 'm0' --parameter-value '123' Set 'p0' option: id=p0-meta_attributes-m0 set=p0-meta_attributes name=m0=123 .INP: configure @@ -222,7 +222,7 @@ </cib> .TRY resource meta p0 show m0 -.EXT crm_resource --meta -r 'p0' -g 'm0' +.EXT crm_resource --meta --resource 'p0' --get-parameter 'm0' 123 .INP: configure .INP: _regtest on @@ -245,7 +245,7 @@ </cib> .TRY resource meta p0 delete m0 -.EXT crm_resource --meta -r 'p0' -d 'm0' +.EXT crm_resource --meta --resource 'p0' --delete-parameter 'm0' Deleted 'p0' option: id=p0-meta_attributes-m0 name=m0 .INP: configure .INP: _regtest on @@ -822,100 +822,57 @@ </configuration> </cib> +.SETENV showobj= .TRY configure rename p3 p4 .EXT crm_resource --show-metadata stonith:null .EXT stonithd metadata .EXT crm_resource --show-metadata ocf:pacemaker:Dummy .EXT crm_resource --show-metadata ocf:heartbeat:Delay -.INP: configure -.INP: _regtest on -.INP: show xml p0 -<?xml version="1.0" ?> -<cib> - <configuration> - <crm_config/> - <nodes/> - <resources> - <clone id="cg"> - <meta_attributes id="cg-meta_attributes"> - <nvpair id="cg-meta_attributes-target-role" name="target-role" value="Stopped"/> - </meta_attributes> - <group id="g"> - <primitive id="p0" class="ocf" provider="pacemaker" type="Dummy"/> - <primitive id="p4" class="ocf" provider="pacemaker" type="Dummy"> - <meta_attributes id="p3-meta_attributes"> - <nvpair id="p3-meta_attributes-target-role" name="target-role" value="Stopped"/> - </meta_attributes> - </primitive> - </group> - </clone> - </resources> - <constraints/> - </configuration> -</cib> - .TRY configure primitive p3 Dummy .EXT crm_resource --show-metadata stonith:null .EXT stonithd metadata .EXT crm_resource --show-metadata ocf:pacemaker:Dummy .EXT crm_resource --show-metadata ocf:heartbeat:Delay .EXT crm_resource --show-metadata ocf:heartbeat:Dummy -.INP: configure -.INP: _regtest on -.INP: show xml p0 -<?xml version="1.0" ?> -<cib> - <configuration> - <crm_config/> - <nodes/> - <resources> - <clone id="cg"> - <meta_attributes id="cg-meta_attributes"> - <nvpair id="cg-meta_attributes-target-role" name="target-role" value="Stopped"/> - </meta_attributes> - <group id="g"> - <primitive id="p0" class="ocf" provider="pacemaker" type="Dummy"/> - <primitive id="p4" class="ocf" provider="pacemaker" type="Dummy"> - <meta_attributes id="p3-meta_attributes"> - <nvpair id="p3-meta_attributes-target-role" name="target-role" value="Stopped"/> - </meta_attributes> - </primitive> - </group> - </clone> - </resources> - <constraints/> - </configuration> -</cib> - .TRY resource stop p3 -.INP: configure -.INP: _regtest on -.INP: show xml p0 -<?xml version="1.0" ?> -<cib> - <configuration> - <crm_config/> - <nodes/> - <resources> - <clone id="cg"> - <meta_attributes id="cg-meta_attributes"> - <nvpair id="cg-meta_attributes-target-role" name="target-role" value="Stopped"/> - </meta_attributes> - <group id="g"> - <primitive id="p0" class="ocf" provider="pacemaker" type="Dummy"/> - <primitive id="p4" class="ocf" provider="pacemaker" type="Dummy"> - <meta_attributes id="p3-meta_attributes"> - <nvpair id="p3-meta_attributes-target-role" name="target-role" value="Stopped"/> - </meta_attributes> - </primitive> - </group> - </clone> - </resources> - <constraints/> - </configuration> -</cib> - -.SETENV showobj= +.TRY resource start p3 +.TRY resource cleanup +.EXT crm_resource --cleanup +Error performing operation: Transport endpoint is not connected +.TRY resource cleanup p3 +.EXT crm_resource --cleanup --resource p3 +Error performing operation: Transport endpoint is not connected +.TRY resource cleanup p3 node1 +.EXT crm_resource --cleanup --resource p3 --node node1 +Error performing operation: Transport endpoint is not connected +.TRY resource cleanup force +.EXT crm_resource --cleanup --force +Error performing operation: Transport endpoint is not connected +.TRY resource cleanup p3 force +.EXT crm_resource --cleanup --resource p3 --force +Error performing operation: Transport endpoint is not connected +.TRY resource cleanup p3 node1 force +.EXT crm_resource --cleanup --resource p3 --node node1 --force +Error performing operation: Transport endpoint is not connected +.TRY resource refresh +.EXT crm_resource --refresh +Error performing operation: Transport endpoint is not connected +.TRY resource refresh p3 +.EXT crm_resource --refresh --resource p3 +Error performing operation: Transport endpoint is not connected +.TRY resource refresh p3 node1 +.EXT crm_resource --refresh --resource p3 --node node1 +Error performing operation: Transport endpoint is not connected +.TRY resource refresh force +.EXT crm_resource --refresh --force +Error performing operation: Transport endpoint is not connected +.TRY resource refresh p3 force +.EXT crm_resource --refresh --resource p3 --force +Error performing operation: Transport endpoint is not connected +.TRY resource refresh p3 node1 force +.EXT crm_resource --refresh --resource p3 --node node1 --force +Error performing operation: Transport endpoint is not connected +.TRY resource stop p3 .TRY configure rm cg .TRY configure ms msg g .TRY resource scores diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.0.0+git.1519721966.9abd841c/test/unittests/test_resource.py new/crmsh-4.0.0+git.1522278003.cd7ae188/test/unittests/test_resource.py --- old/crmsh-4.0.0+git.1519721966.9abd841c/test/unittests/test_resource.py 2018-02-27 09:59:26.000000000 +0100 +++ new/crmsh-4.0.0+git.1522278003.cd7ae188/test/unittests/test_resource.py 2018-03-29 01:00:03.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (C) 2014 Kristoffer Gronlund <kgronlund@suse.com> +# Copyright (C) 2014-2018 Kristoffer Gronlund <kgronlund@suse.com> # See COPYING for license information. @@ -26,10 +26,10 @@ utils.ext_cmd = mockcmd rscui = ui_resource.RscMgmt() assert rscui.do_maintenance(mc, 'rsc1') is True - assert commands[-1] == ("crm_resource -r 'rsc1' --meta -p maintenance -v 'true'",) + assert commands[-1] == ("crm_resource --resource 'rsc1' --meta --set-parameter maintenance --parameter-value 'true'",) assert rscui.do_maintenance(mc, 'rsc1', 'on') is True - assert commands[-1] == ("crm_resource -r 'rsc1' --meta -p maintenance -v 'true'",) + assert commands[-1] == ("crm_resource --resource 'rsc1' --meta --set-parameter maintenance --parameter-value 'true'",) assert rscui.do_maintenance(mc, 'rsc1', 'off') is True - assert commands[-1] == ("crm_resource -r 'rsc1' --meta -p maintenance -v 'false'",) + assert commands[-1] == ("crm_resource --resource 'rsc1' --meta --set-parameter maintenance --parameter-value 'false'",) finally: utils.ext_cmd = _pre_ext_cmd
participants (1)
-
root@hilbert.suse.de