debian/0000775000000000000000000000000012377707121007177 5ustar debian/copyright0000664000000000000000000000320112035040554011115 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: crmsh Source: http://savannah.nongnu.org/projects/crmsh/ Files: debian/* Copyright: 2012 Martin Loschwitz License: GPL-2+ Files: * Copyright: 2008-2011 Dejan Muhamedagic License: GPL-2+ Files: doc/Makefile.am modules/Makefile.am templates/gfs2-base templates/Makefile.am templates/gfs2 Copyright: 2008 - 2011 Andrew Beekhof License: GPL-2+ Files: modules/crm_pssh.py Copyright: 2003-2008, Brent N. Chun 2009 Andrew McNabb License: GPL-2+ Files: modules/pacemaker.py Copyright: 2009 Yan Gao License: GPL-2+ Files: test/testcases/Makefile.am test/Makefile.am Copyright: 2004 International Business Machines License: GPL-2+ Files: test/crm_regression.sh Copyright: 2009 Lars Marowsky-Bree License: GPL-2+ License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/source/0000775000000000000000000000000012035044023010461 5ustar debian/source/format0000664000000000000000000000001412035033133011667 0ustar 3.0 (quilt) debian/changelog0000664000000000000000000001003512377707121011050 0ustar crmsh (1.2.5+hg1034-1ubuntu4) trusty; urgency=medium * cibconf: repair configure load update (LP: #1353011). -- Rafael David Tinoco Thu, 28 Aug 2014 13:17:21 -0700 crmsh (1.2.5+hg1034-1ubuntu3) trusty; urgency=medium * d/control: Add missing dependency on python-lxml (LP: #1289262). -- James Page Fri, 07 Mar 2014 10:42:37 +0000 crmsh (1.2.5+hg1034-1ubuntu2) trusty; urgency=medium * Rebuild to drop files installed into /usr/share/pyshared. -- Matthias Klose Sun, 23 Feb 2014 13:46:40 +0000 crmsh (1.2.5+hg1034-1ubuntu1) trusty; urgency=low * Resynchronise with Debian. Remaining changes: - Architecture: all, not any. - Build-Depends: pkg-config, asciidoc, libxml2-utils, xsltproc, docbook-xml, docbook-xsl. - Drop Depends on python, python-support for crmsh binary. - Convert to dh_python2. - Breaks/Replaces pacemaker (<< 1.1.8-1) to not fail on upgrades. -- Colin Watson Fri, 25 Oct 2013 17:21:17 +0100 crmsh (1.2.5+hg1034-1) unstable; urgency=low * New upstream checkout -- Martin Loschwitz Mon, 05 Aug 2013 05:21:29 +0000 crmsh (1.2.5+hg1006-1) unstable; urgency=low * New upstream checkout for Pacemaker 1.1.10 -- Martin Loschwitz Fri, 02 Aug 2013 07:37:50 +0000 crmsh (1.2.5+hg953-3) unstable; urgency=low * Upload to unstable instead of experimental -- Martin Loschwitz Fri, 02 Aug 2013 06:52:11 +0000 crmsh (1.2.5+hg953-2ubuntu5) saucy; urgency=low * Build-depend on libcrmcluster4-dev rather than libcrmcluster2-dev. -- Colin Watson Tue, 10 Sep 2013 14:06:20 +0100 crmsh (1.2.5+hg953-2ubuntu4) saucy; urgency=low * debian/control: Breaks/Replaces pacemaker (<< 1.1.8-1) to not fail on upgrades. -- Andres Rodriguez Tue, 30 Jul 2013 17:54:03 -0400 crmsh (1.2.5+hg953-2ubuntu3) saucy; urgency=low * debian/control: Drop Build-Depends on python-support. -- Andres Rodriguez Sun, 28 Jul 2013 12:11:26 -0400 crmsh (1.2.5+hg953-2ubuntu2) saucy; urgency=low * debian/control: Build-Depend on docbook-xsl. -- Andres Rodriguez Thu, 25 Jul 2013 13:52:54 -0400 crmsh (1.2.5+hg953-2ubuntu1) saucy; urgency=low * debian/control: - Architecture: all, not any. - Build-Dep: pkg-config, asciidoc, libxml2-utils, xsltproc, docbook-xml - Drop Depends on python, python-support for crmsh binary. - Add X-Python-Version. * debian/rules: Build with python2. -- Andres Rodriguez Wed, 17 Jul 2013 11:37:04 -0400 crmsh (1.2.5+hg953-2) experimental; urgency=low * Build-Depend on libcib3-dev instead of libcib2-dev -- Martin Loschwitz Fri, 19 Apr 2013 07:08:47 +0000 crmsh (1.2.5+hg953-1) experimental; urgency=low * New upstream release -- Martin Loschwitz Wed, 20 Mar 2013 23:11:44 +0000 crmsh (1.2.0+hg20121010-1) unstable; urgency=low * New upstream checkout to catch some additional bugfixes * debian/control: Depend on version 1.1.8+git20121010 of libcib as well as libcrmcommon and libpengine to make sure we get the versions with proper .pc files (Closes: #690055) -- Martin Loschwitz Wed, 10 Oct 2012 11:39:06 +0000 crmsh (1.2.0+hg20121009-3) unstable; urgency=low * debian/control: Fix possible circular build dependency by using the real library package names instead of pacemaker-dev (Closes: #690055) -- Martin Loschwitz Tue, 09 Oct 2012 17:29:01 +0000 crmsh (1.2.0+hg20121009-2) unstable; urgency=low * debian/control: Set the maintainer field to the HA group instead of me personally. (Closes: #690055) -- Martin Loschwitz Tue, 09 Oct 2012 16:20:15 +0000 crmsh (1.2.0+hg20121009-1) unstable; urgency=low * Initial release (Closes: #690055) -- Martin Loschwitz Tue, 09 Oct 2012 14:36:09 +0000 debian/compat0000664000000000000000000000000212035041534010363 0ustar 9 debian/control0000664000000000000000000000265512306321222010574 0ustar Source: crmsh Section: admin Priority: extra Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian HA Maintainers Uploaders: Martin Loschwitz Build-Depends: debhelper (>= 9.0.0), cluster-glue-dev, hardening-wrapper, python-all-dev, dh-autoreconf, libcib3-dev, libcrmcluster4-dev, libcrmcommon3-dev (>= 1.1.8+git20121010), libpe-rules2-dev, libpe-status4-dev, libpengine4-dev (>= 1.1.8+git20121010), libstonithd2-dev, libtransitioner2-dev, liblrmd1-dev, libcrmservice1-dev, pkg-config, asciidoc, libxml2-utils, xsltproc, docbook-xml, docbook-xsl X-Python-Version: >= 2.5 Standards-Version: 3.9.3 Homepage: http://savannah.nongnu.org/projects/crmsh/ Package: crmsh Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-lxml Recommends: pacemaker (>= 1.1.8-1) Breaks: pacemaker (<< 1.1.8-1) Replaces: pacemaker (<< 1.1.8-1) Description: CRM shell for the pacemaker cluster manager This package contains the famous CRM shell (crmsh) written by Dejan Muhamedagic. Use it to manipulate the cluster information base (CIB) of a running pacemaker cluster without having to fiddle with XML snipets. The CRM shell used to be part of the pacemaker package itself and became a separate project lately. If you are running a pacemaker cluster, then you should most definetely have this package installed. debian/patches/0000775000000000000000000000000012377707116010632 5ustar debian/patches/series0000664000000000000000000000006212377707116012045 0ustar Medium-cibconf-repair-configure-load-update.patch debian/patches/Medium-cibconf-repair-configure-load-update.patch0000664000000000000000000001305512377707116022134 0ustar Description: [PATCH] Medium: cibconf: repair configure load update The save method has to be told not to remove objects on load update (as in edit). The file testcase was updated to test better the load update command. Origin: upstream, commit: b146349 Author: Dejan Muhamedagic Bug-Ubuntu: https://bugs.launchpad.net/bugs/1353011 Last-Update: 2014-08-08 * Fixes LP: #1353011 --- modules/cibconfig.py | 24 ++++++++++++++---------- modules/ui.py | 6 +++--- test/testcases/file | 4 ++-- test/testcases/file.exp | 6 +++--- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/modules/cibconfig.py b/modules/cibconfig.py index cbd0e35..4189ba6 100644 --- a/modules/cibconfig.py +++ b/modules/cibconfig.py @@ -278,7 +278,7 @@ class CibObjectSet(object): s = ''.join(f) if f != sys.stdin: f.close() - return self.save(s) + return self.save(s, no_remove=True) def repr(self, format=format): ''' @@ -287,7 +287,7 @@ class CibObjectSet(object): ''' return '' - def save(self, s): + def save(self, s, no_remove=False): ''' For each object: - try to find a corresponding object in obj_set @@ -454,7 +454,7 @@ class CibObjectSetCli(CibObjectSet): id = type return id - def save(self, s): + def save(self, s, no_remove=False): ''' Save a user supplied cli format configuration. On errors user is typically asked to review the @@ -465,7 +465,8 @@ class CibObjectSetCli(CibObjectSet): changes are made. ''' edit_d = {} - id_set = set([]) + id_set = set() + del_set = set() rc = True err_buf.start_tmp_lineno() cp = CliParser() @@ -484,10 +485,11 @@ class CibObjectSetCli(CibObjectSet): err_buf.stop_tmp_lineno() # we can't proceed if there was a syntax error, but we # can ask the user to fix problems - rc &= self.is_edit_valid(id_set) + if not no_remove: + rc &= self.is_edit_valid(id_set) + del_set = self.obj_ids - id_set if not rc: return rc - del_set = self.obj_ids - id_set mk_set = id_set - self.obj_ids upd_set = id_set & self.obj_ids rc = cib_factory.set_update(edit_d, mk_set, upd_set, del_set) @@ -519,7 +521,7 @@ class CibObjectSetRaw(CibObjectSet): else: return node.get("id") - def save(self, s): + def save(self, s, no_remove=False): try: cib_elem = etree.fromstring(s) except etree.ParseError, msg: @@ -529,7 +531,8 @@ class CibObjectSetRaw(CibObjectSet): if not show_unrecognized_elems(cib_elem): return False rc = True - id_set = set([]) + id_set = set() + del_set = set() edit_d = {} for node in get_top_cib_nodes(cib_elem, []): id = self._get_id(node) @@ -542,10 +545,11 @@ class CibObjectSetRaw(CibObjectSet): rc = False id_set.add(id) edit_d[id] = node - rc &= self.is_edit_valid(id_set) + if not no_remove: + rc &= self.is_edit_valid(id_set) + del_set = self.obj_ids - id_set if not rc: return rc - del_set = self.obj_ids - id_set mk_set = id_set - self.obj_ids upd_set = id_set & self.obj_ids rc = cib_factory.set_update(edit_d, mk_set, upd_set, del_set, "xml") diff --git a/modules/ui.py b/modules/ui.py index eff3b64..9d8478e 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -734,7 +734,7 @@ class Template(UserInterface): if not utils.ask("This operation will erase all changes. Do you want to proceed?"): return False cib_factory.erase() - set_obj = mkset_obj("NOOBJ") + set_obj = mkset_obj() rc = set_obj.import_file(tmp) try: os.unlink(tmp) @@ -1825,9 +1825,9 @@ class CibConfig(UserInterface): return False cib_factory.erase() if xml: - set_obj = mkset_obj("xml", "NOOBJ") + set_obj = mkset_obj("xml") else: - set_obj = mkset_obj("NOOBJ") + set_obj = mkset_obj() return set_obj.import_file(url) def graph(self, cmd, *args): diff --git a/test/testcases/file b/test/testcases/file index e739d67..9f6a470 100644 --- a/test/testcases/file +++ b/test/testcases/file @@ -2,10 +2,10 @@ configure save sample.txt %ext cat sample.txt configure erase nodes configure load replace sample.txt +%ext sed -i 's/60s/2m/' sample.txt session Load update configure -erase -erase nodes +delete m1 p1 load update sample.txt . configure show diff --git a/test/testcases/file.exp b/test/testcases/file.exp index bf08c66..0755a26 100644 --- a/test/testcases/file.exp +++ b/test/testcases/file.exp @@ -17,11 +17,11 @@ property $id="cib-bootstrap-options" \ .EXT >/dev/null &1 .TRY configure load replace sample.txt .EXT >/dev/null &1 +.EXT sed -i 's/60s/2m/' sample.txt .TRY Load update .EXT >/dev/null &1 .INP: configure -.INP: erase -.INP: erase nodes +.INP: delete m1 p1 .INP: load update sample.txt .TRY configure show .EXT >/dev/null &1 @@ -36,5 +36,5 @@ primitive st stonith:null \ ms m1 p2 clone c1 p1 property $id="cib-bootstrap-options" \ - default-action-timeout="60s" + default-action-timeout="2m" .EXT rm sample.txt -- 1.9.1 debian/rules0000775000000000000000000000170612232515012010245 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # enable hardening export DEB_BUILD_HARDENING=1 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --with autoreconf,python2 override_dh_installdocs: dh_installdocs rm -rf $(CURDIR)/debian/crmsh/usr/share/doc/crmsh/COPYING override_dh_compress: find $(CURDIR)/debian/crmsh/ -name '*.pyo' | xargs rm -rf find $(CURDIR)/debian/crmsh/ -name '*.pyc' | xargs rm -rf dh_compress