From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 07:31:07 2019 Received: (at submit) by debbugs.gnu.org; 8 Sep 2019 11:31:07 +0000 Received: from localhost ([127.0.0.1]:38466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i6vPN-00012b-Su for submit@debbugs.gnu.org; Sun, 08 Sep 2019 07:31:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:41131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i6vPK-0000zd-8L for submit@debbugs.gnu.org; Sun, 08 Sep 2019 07:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60733) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6vPJ-0008WK-1H for guix-patches@gnu.org; Sun, 08 Sep 2019 07:31:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6vPF-0003TH-FD for guix-patches@gnu.org; Sun, 08 Sep 2019 07:31:00 -0400 Received: from mail-out.m-online.net ([2001:a60:0:28:0:1:25:1]:35233) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i6vPC-0003Qz-Qg for guix-patches@gnu.org; Sun, 08 Sep 2019 07:30:55 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46R8HY3z4Rz1rVw6 for ; Sun, 8 Sep 2019 13:30:49 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46R8HY3nqDz1r5ft for ; Sun, 8 Sep 2019 13:30:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id f89J8imv7ih7 for ; Sun, 8 Sep 2019 13:30:48 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-61-50.dynamic.mnet-online.de [188.174.61.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Sun, 8 Sep 2019 13:30:48 +0200 (CEST) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id B9C16600A8 for ; Sun, 8 Sep 2019 13:32:51 +0200 (CEST) From: Hartmut Goebel To: guix-patches@gnu.org Subject: [PATCH 0/2] Add python-distro and debops. Date: Sun, 8 Sep 2019 13:30:48 +0200 Message-Id: <20190908113048.19618-1-h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:a60:0:28:0:1:25:1 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hartmut Goebel (2): gnu: Add python-distro. -- required by debops gnu: Add debops. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 07:35:09 2019 Received: (at 37341) by debbugs.gnu.org; 8 Sep 2019 11:35:09 +0000 Received: from localhost ([127.0.0.1]:38471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i6vTD-0002BH-QA for submit@debbugs.gnu.org; Sun, 08 Sep 2019 07:35:09 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:48023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i6vTC-0002An-6j for 37341@debbugs.gnu.org; Sun, 08 Sep 2019 07:35:02 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46R8NP1cYBz1rK4C for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:35:01 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46R8NP07ydz1r5fx for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:35:01 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 4DNkIix9MCz2 for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:34:59 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-61-50.dynamic.mnet-online.de [188.174.61.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:34:59 +0200 (CEST) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id C988C600A8 for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:37:02 +0200 (CEST) From: Hartmut Goebel To: 37341@debbugs.gnu.org Subject: [PATCH 1/2] gnu: Add python-distro. Date: Sun, 8 Sep 2019 13:34:58 +0200 Message-Id: <20190908113459.20232-1-h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 37341 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/packages/python-xyz.scm (python-distro): New variable. --- gnu/packages/python-xyz.scm | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 2827ddf770..67aa68f4de 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -19,7 +19,7 @@ ;;; Copyright © 2015, 2016 Chris Marusich ;;; Copyright © 2016 Danny Milosavljevic ;;; Copyright © 2016 Lukas Gradl -;;; Copyright © 2016, 2018 Hartmut Goebel +;;; Copyright © 2016, 2018-2019 Hartmut Goebel ;;; Copyright © 2016 Daniel Pimentel ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2016, 2017 Troy Sankey @@ -16168,3 +16168,30 @@ ElementTree library and for the @uref{http://lxml.de, lxml.etree} library. For lxml.etree this package can be useful for providing XPath 2.0 selectors, because lxml.etree already has it's own implementation of XPath 1.0.") (license license:expat))) + +(define-public python-distro + (package + (name "python-distro") + (version "1.4.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "distro" version)) + (sha256 + (base32 + "0mrg75w4ap7mdzyga75yaid9n8bgb345ih5mwjp3plj6v1jxwb9n")))) + (build-system python-build-system) + (native-inputs + `(("python-pytest" ,python-pytest))) + (home-page "https://github.com/nir0s/distro") + (synopsis + "OS platform information API") + (description + "@code{distro} provides information about the OS distribution it runs on, +such as a reliable machine-readable ID, or version information. + +It is the recommended replacement for Python's original +`platform.linux_distribution` function (which will be removed in Python 3.8). +@code{distro} also provides a command-line interface to output the platform +information in various formats.") + (license license:asl2.0))) -- 2.21.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 07:35:13 2019 Received: (at 37341) by debbugs.gnu.org; 8 Sep 2019 11:35:13 +0000 Received: from localhost ([127.0.0.1]:38474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i6vTJ-0002BU-5K for submit@debbugs.gnu.org; Sun, 08 Sep 2019 07:35:13 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:40668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i6vTE-0002BI-Eo for 37341@debbugs.gnu.org; Sun, 08 Sep 2019 07:35:06 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46R8NR74BRz1rK4B for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:35:03 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46R8NR6zfTz1r5fv for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:35:03 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 8e1rH70BBRvO for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:35:01 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-61-50.dynamic.mnet-online.de [188.174.61.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:35:01 +0200 (CEST) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id DF3AD60261 for <37341@debbugs.gnu.org>; Sun, 8 Sep 2019 13:37:02 +0200 (CEST) From: Hartmut Goebel To: 37341@debbugs.gnu.org Subject: [PATCH 2/2] gnu: Add debops. Date: Sun, 8 Sep 2019 13:34:59 +0200 Message-Id: <20190908113459.20232-2-h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190908113459.20232-1-h.goebel@crazy-compilers.com> References: <20190908113459.20232-1-h.goebel@crazy-compilers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 37341 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (debops): New variable. * gnu/packages/patches/debops-constants-for-external-program-names.patch, gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch: New files. * gnu/local.mk: Add them. --- gnu/local.mk | 2 + gnu/packages/admin.scm | 98 +++++++ ...constants-for-external-program-names.patch | 273 ++++++++++++++++++ ...ps-debops-defaults-fall-back-to-less.patch | 45 +++ 4 files changed, 418 insertions(+) create mode 100644 gnu/packages/patches/debops-constants-for-external-program-names.patch create mode 100644 gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch diff --git a/gnu/local.mk b/gnu/local.mk index b7a5ef825b..2651d57781 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -760,6 +760,8 @@ dist_patch_DATA = \ %D%/packages/patches/dbus-helper-search-path.patch \ %D%/packages/patches/dbus-CVE-2019-12749.patch \ %D%/packages/patches/dealii-mpi-deprecations.patch \ + %D%/packages/patches/debops-constants-for-external-program-names.patch \ + %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ %D%/packages/patches/deja-dup-use-ref-keyword-for-iter.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ %D%/packages/patches/diffutils-gets-undeclared.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 3e75b73dcb..d21f4ab66a 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -25,6 +25,7 @@ ;;; Copyright © 2018 Pierre Neidhardt ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2019 Björn Höfling +;;; Copyright © 2019 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -58,6 +59,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages check) + #:use-module (gnu packages crypto) #:use-module (gnu packages cyrus-sasl) #:use-module (gnu packages dns) #:use-module (gnu packages file) @@ -110,6 +112,7 @@ #:use-module (gnu packages boost) #:use-module (gnu packages elf) #:use-module (gnu packages mpi) + #:use-module (gnu packages version-control) #:use-module (gnu packages web)) (define-public aide @@ -1901,6 +1904,101 @@ ad hoc task execution, and multinode orchestration---including trivializing things like zero-downtime rolling updates with load balancers.") (license license:gpl3+))) +(define-public debops + (package + (name "debops") + (version "1.1.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/debops/debops") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "052b2dykdn35pdpn9s4prawl6nl6yzih8nyf54hpvhpisvjrm1v5")) + (patches + (search-patches "debops-constants-for-external-program-names.patch" + "debops-debops-defaults-fall-back-to-less.patch")))) + (build-system python-build-system) + (native-inputs + `(("git" ,git))) + (inputs + `(("ansible" ,ansible) + ("encfs" ,encfs) + ("fuse" ,fuse) + ("util-linux" ,util-linux) ;; for umount + ("findutils" ,findutils) + ("gnupg" ,gnupg) + ("which" ,which))) + (propagated-inputs + `(("python-future" ,python-future) + ("python-distro" ,python-distro))) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'nuke-debops-update + (lambda _ + (chmod "bin/debops-update" #o755) ; FIXME work-around git-fetch issue + (with-output-to-file "bin/debops-update" + (lambda () + (format #t "#!/bin/sh +echo 'debops is installed via guix. guix-update is useless in this case. +Please use `guix package -u debops` instead.'"))) + #t)) + ;; patch shebangs only in actuall scripts, not in files included in + ;; roles (which are to be delivered to the targte systems) + (delete `patch-generated-file-shebangs) + (replace 'patch-source-shebangs + (lambda _ + (for-each patch-shebang + (find-files "bin" + (lambda (file stat) + ;; Filter out symlinks. + (eq? 'regular (stat:type stat))) + #:stat lstat)))) + (add-after 'unpack 'fix-paths + (lambda _ + (define (substitute-program-names file) + ;; e.g. ANSIBLE_PLAYBOOK = '/gnu/store/…/bin/ansible-playbook' + (for-each + (lambda (name) + (let ((varname (string-upcase + (string-map + (lambda (c) (if (char=? c #\-) #\_ c)) + name)))) + (substitute* file + (((string-append "^(" varname " = )'.*'") line prefix) + (string-append prefix "'" (which name) "'"))))) + '("ansible-playbook" "encfs" "find" "fusermount" + "umount" "gpg" "ansible" "which"))) + (for-each substitute-program-names + '("bin/debops" + "bin/debops-padlock" + "bin/debops-task" + "debops/__init__.py" + "debops/cmds/__init__.py")) + #t))))) + (home-page "https://www.debops.org/") + (synopsis "Collection of general-purpose Ansible roles") + (description "The Ansible roles provided by that can be used to manage +Debian or Ubuntu hosts. In addition, a default set of Ansible playbooks can +be used to apply the provided roles in a controlled way, using Ansible +inventory groups. + +The roles are written with a high customization in mind, which can be done +using Ansible inventory. This way the role and playbook code can be shared +between multiple environments, with different configuration in to each one. + +Services can be managed on a single host, or spread between multiple hosts. +DebOps provides support for different SQL and NoSQL databases, web servers, +programming languages and specialized applications useful in a data center +environment or in a cluster. The project can also be used to deploy +virtualization environments using KVM/libvirt, Docker or LXC technologies to +manage virtual machines and/or containers.") + (license license:gpl3+))) + (define-public emacs-ansible-doc (let ((commit "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")) (package diff --git a/gnu/packages/patches/debops-constants-for-external-program-names.patch b/gnu/packages/patches/debops-constants-for-external-program-names.patch new file mode 100644 index 0000000000..d599dc475f --- /dev/null +++ b/gnu/packages/patches/debops-constants-for-external-program-names.patch @@ -0,0 +1,273 @@ +From fcb9e679c219c559e07a84b3035555a10886c570 Mon Sep 17 00:00:00 2001 +From: Hartmut Goebel +Date: Thu, 8 Aug 2019 15:19:48 +0200 +Subject: [PATCH] Scripts: Use constants for external program names. + +This makes it much, much easier to replace the program +with one using an absolute path. This is necessary for +e.g. Guix to keep references to these external programs. +--- + bin/debops | 8 +++++--- + bin/debops-padlock | 20 ++++++++++++++------ + bin/debops-task | 7 +++++-- + bin/debops-update | 17 ++++++++++------- + debops/__init__.py | 16 +++++++++++----- + debops/cmds/__init__.py | 6 ++++-- + 6 files changed, 49 insertions(+), 25 deletions(-) + +diff --git a/bin/debops b/bin/debops +index 2b7ad3f88..1a8b0cae1 100755 +--- a/bin/debops ++++ b/bin/debops +@@ -59,6 +59,9 @@ ConfigFileHeader = """\ + # You can manipulate the contents of this file via `.debops.cfg`. + """ + ++# External programms used. List here for easy substitution for ++# hard-coded paths. ++ANSIBLE_PLAYBOOK = 'ansible-playbook' + + def write_config(filename, config): + cfgparser = configparser.ConfigParser() +@@ -131,7 +134,7 @@ def gen_ansible_cfg(filename, config, project_root, playbooks_path, + os.path.join(playbooks_path, "roles"), + "/etc/ansible/roles"))) + +- ansible_version_out = subprocess.check_output(["ansible-playbook", ++ ansible_version_out = subprocess.check_output([ANSIBLE_PLAYBOOK, + "--version"]).decode() + + # Get first line and split by spaces to get second 'word'. +@@ -256,12 +259,11 @@ def main(cmd_args): + print("Running Ansible playbooks:") + for element in play_list: + print(element) +- return subprocess.call(['ansible-playbook'] + play_list + arg_list) ++ return subprocess.call([ANSIBLE_PLAYBOOK] + play_list + arg_list) + finally: + if revert_unlock: + padlock_lock(encfs_encrypted) + +- + try: + sys.exit(main(sys.argv[1:])) + except KeyboardInterrupt: +diff --git a/bin/debops-padlock b/bin/debops-padlock +index bfdfb8e06..706a26091 100755 +--- a/bin/debops-padlock ++++ b/bin/debops-padlock +@@ -67,6 +67,14 @@ devrandom = os.environ.get('DEVRANDOM', "/dev/urandom") + + SCRIPT_FILENAME = 'padlock-script' + ++# External programms used. List here for easy substitution for ++# hard-coded paths. ++ENCFS = 'encfs' ++FIND = 'find' ++FUSERMOUNT = 'fusermount' ++UMOUNT = 'umount' ++GPG = 'gpg' ++ + # ---- DebOps environment setup ---- + + +@@ -80,9 +88,9 @@ def main(subcommand_func, **kwargs): + # Make sure required commands are present + # OS X compatibility + if sys.platform == 'darwin': +- require_commands('encfs', 'find', 'umount', 'gpg') ++ require_commands(ENCFS, FIND, UMOUNT, GPG) + else: +- require_commands('encfs', 'find', 'fusermount', 'gpg') ++ require_commands(ENCFS, FIND, FUSERMOUNT, GPG) + + inventory_path = find_inventorypath(project_root, required=False) + # If inventory hasn't been found automatically, assume it's the default +@@ -121,7 +129,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients): + # Generate a random password and encrypt it with GPG keys of recipients. + print("Generating a random", ENCFS_KEYFILE_LENGTH, "char password") + pwd = gen_pwd() +- gpg = subprocess.Popen(['gpg', '--encrypt', '--armor', ++ gpg = subprocess.Popen([GPG, '--encrypt', '--armor', + '--output', encfs_keyfile] + recipients, + stdin=subprocess.PIPE) + gpg.communicate(pwd.encode('utf-8')) +@@ -133,9 +141,9 @@ def init(encfs_decrypted, encfs_encrypted, recipients): + # NB2: We can not use padlock_unlock here, because the config file + # does not yet exist. + encfs = subprocess.Popen([ +- 'encfs', encfs_encrypted, encfs_decrypted, ++ ENCFS, encfs_encrypted, encfs_decrypted, + '--extpass', +- 'gpg --decrypt --no-mdc-warning --output - '+shquote(encfs_keyfile)], ++ GPG + ' --decrypt --no-mdc-warning --output - '+shquote(encfs_keyfile)], + stdin=subprocess.PIPE) + encfs.communicate(('p\n'+pwd).encode('utf-8')) + +@@ -154,7 +162,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients): + + # Protect the EncFS configuration file by also encrypting it with + # the GPG keys of recipients. +- subprocess.call(['gpg', '--encrypt', '--armor', ++ subprocess.call([GPG, '--encrypt', '--armor', + '--output', encfs_configfile+'.asc'] + + recipients + [encfs_configfile]) + os.remove(encfs_configfile) +diff --git a/bin/debops-task b/bin/debops-task +index 223e5f834..dc31ad4e6 100755 +--- a/bin/debops-task ++++ b/bin/debops-task +@@ -49,11 +49,14 @@ project_root = find_debops_project(required=True) + # todo: need to decide on semantics! + # config = read_config(project_root) + ++# External programms used. List here for easy substitution for ++# hard-coded paths. ++ANSIBLE = 'ansible' + + # ---- Main script ---- + + # Make sure required commands are present +-require_commands('ansible') ++require_commands(ANSIBLE) + + ansible_inventory = find_inventorypath(project_root) + +@@ -71,5 +74,5 @@ if INSECURE: + os.environ['ANSIBLE_HOST_KEY_CHECKING'] = 'False' + + # Run ansible with custom environment +-cmd = ['ansible'] + module + sys.argv[1:] ++cmd = [ANSIBLE] + module + sys.argv[1:] + subprocess.call(cmd) +diff --git a/bin/debops-update b/bin/debops-update +index 88c5e2c82..e650ba029 100755 +--- a/bin/debops-update ++++ b/bin/debops-update +@@ -90,6 +90,9 @@ GALAXY_REQUIREMENTS = "galaxy/requirements.txt" + # Default Ansible Galaxy user account name + GALAXY_ACCOUNT = "debops" + ++# External programms used. List here for easy substitution for ++# hard-coded paths. ++GIT = 'git' + + # ---- Functions ---- + +@@ -137,7 +140,7 @@ def clone_git_repository(repo_uri, branch, destination, dry_run=False): + if dry_run: + print("Cloning '%s' to %s..." % (repo_uri, destination)) + else: +- subprocess.call(['git', 'clone', '--quiet', '--branch', branch, ++ subprocess.call([GIT, 'clone', '--quiet', '--branch', branch, + repo_uri, destination]) + + +@@ -152,22 +155,22 @@ def update_git_repository(path, dry_run=False, remote_uri=False): + os.chdir(path) + + if dry_run: +- subprocess.call(['git', 'fetch']) +- subprocess.call(['git', 'diff', 'HEAD', 'origin', '--stat']) ++ subprocess.call([GIT, 'fetch']) ++ subprocess.call([GIT, 'diff', 'HEAD', 'origin', '--stat']) + else: + # Get the current sha of the head branch + current_sha = subprocess.check_output( +- ['git', 'rev-parse', 'HEAD']).strip() ++ [GIT, 'rev-parse', 'HEAD']).strip() + + # Fetch it silently and store the new sha +- subprocess.call(['git', 'fetch', '--quiet']) ++ subprocess.call([GIT, 'fetch', '--quiet']) + fetch_sha = subprocess.check_output( +- ['git', 'rev-parse', 'FETCH_HEAD']).strip() ++ [GIT, 'rev-parse', 'FETCH_HEAD']).strip() + + if current_sha != fetch_sha: + print() + print('--') +- subprocess.call(['git', 'merge', fetch_sha]) ++ subprocess.call([GIT, 'merge', fetch_sha]) + + if remote_uri: + compare_uri = (remote_uri + '/compare/' + current_sha[:7] +diff --git a/debops/__init__.py b/debops/__init__.py +index 1c2cedcb0..42a76fdcd 100644 +--- a/debops/__init__.py ++++ b/debops/__init__.py +@@ -93,6 +93,12 @@ ENCFS_KEYFILE = ".encfs6.keyfile" + # Length of the random EncFS password stored in encrypted keyfile + ENCFS_KEYFILE_LENGTH = 256 + ++# External programms used. List here for easy substitution for ++# hard-coded paths. ++ENCFS = 'encfs' ++FUSERMOUNT = 'fusermount' ++UMOUNT = 'umount' ++GPG = 'gpg' + + # ---- Functions ---- + +@@ -180,9 +186,9 @@ def padlock_lock(encrypted_path): + return False + # OS X compatibility + if sys.platform == 'darwin': +- subprocess.call(['umount', decrypted_path]) ++ subprocess.call([UMOUNT, decrypted_path]) + else: +- subprocess.call(['fusermount', '-u', decrypted_path]) ++ subprocess.call([FUSERMOUNT, '-u', decrypted_path]) + return True + + +@@ -237,14 +243,14 @@ def padlock_unlock(encrypted_path): + # Start encfs. It will wait for input on the `configfile` named + # pipe. + encfs = subprocess.Popen([ +- 'encfs', encrypted_path, decrypted_path, ++ ENCFS, encrypted_path, decrypted_path, + '--extpass', +- 'gpg --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)]) ++ GPG + ' --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)]) + # now decrypt the config and write it into the named pipe + with open(configfile, 'w') as fh: + # NB: gpg must write to stdout to avoid it is asking whether + # the file should be overwritten +- subprocess.Popen(['gpg', ++ subprocess.Popen([GPG, + '--decrypt', '--no-mdc-warning', '--output', '-', + crypted_configfile], stdout=fh).wait() + encfs.wait() +diff --git a/debops/cmds/__init__.py b/debops/cmds/__init__.py +index b221fa191..d9477be80 100644 +--- a/debops/cmds/__init__.py ++++ b/debops/cmds/__init__.py +@@ -55,6 +55,9 @@ SCRIPT_NAME = os.path.basename(sys.argv[0]) + # command line) + INSECURE = bool(os.environ.get('INSECURE', False)) + ++# External programms used. List here for easy substitution for ++# hard-coded paths. ++WHICH = 'which' + + def error_msg(message, severity="Error"): + """ +@@ -64,13 +67,12 @@ def error_msg(message, severity="Error"): + if severity == "Error": + raise SystemExit(1) + +- + def require_commands(*cmd_names): + """ + Check if required commands exist. + """ + def command_exists(cmd_name): +- which = "where" if platform.system() == "Windows" else "which" ++ which = "where" if platform.system() == "Windows" else WHICH + return not subprocess.call([which, cmd_name], + stdout=DEVNULL, stderr=subprocess.STDOUT) + +-- +2.21.0 + diff --git a/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch b/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch new file mode 100644 index 0000000000..bbb6b7c08e --- /dev/null +++ b/gnu/packages/patches/debops-debops-defaults-fall-back-to-less.patch @@ -0,0 +1,45 @@ +From 5059daf8bd59a83f520c14731173ea76ce8b8661 Mon Sep 17 00:00:00 2001 +From: Hartmut Goebel +Date: Sun, 8 Sep 2019 13:09:15 +0200 +Subject: [PATCH] [debops-defaults] If `view` is not available, try less, etc. + +--- + bin/debops-defaults | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/bin/debops-defaults b/bin/debops-defaults +index 9dd87fe0a..3e3db4c41 100755 +--- a/bin/debops-defaults ++++ b/bin/debops-defaults +@@ -96,13 +96,22 @@ def main(role_list): + config = read_config(project_root) + playbooks_path = find_playbookpath(config, project_root, required=True) + +- # Make sure required commands are present +- require_commands('view') +- +- if sys.stdout.isatty(): ++ # Check if one of the output commands is present ++ sys.stdout = io.BytesIO() # suppress error message, if any ++ for cmd_args in (('view', '+set ft=yaml', '-'), ++ ('less', '-'), ++ ('more', '-')): ++ try: ++ require_commands(cmd_args[0]) ++ break ++ except SystemExit: ++ # this command was not found ++ cmd_args = None ++ sys.stdout = sys.__stdout__ ++ ++ if cmd_args and sys.stdout.isatty(): + # if script is run as standalone, redirect to view +- view = subprocess.Popen(['view', '+set ft=yaml', '-'], +- stdin=subprocess.PIPE) ++ view = subprocess.Popen(cmd_args, stdin=subprocess.PIPE) + try: + aggregate_defaults(playbooks_path, role_list, view.stdin) + except IOError as e: +-- +2.21.0 + -- 2.21.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 26 11:20:59 2019 Received: (at 37341-close) by debbugs.gnu.org; 26 Sep 2019 15:20:59 +0000 Received: from localhost ([127.0.0.1]:44276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDVZj-0004IG-3o for submit@debbugs.gnu.org; Thu, 26 Sep 2019 11:20:59 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:33859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDVZg-0004I0-Hj for 37341-close@debbugs.gnu.org; Thu, 26 Sep 2019 11:20:57 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46fJXd5kB1z1rNRd for <37341-close@debbugs.gnu.org>; Thu, 26 Sep 2019 17:20:49 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46fJXd4CGcz1qqkW for <37341-close@debbugs.gnu.org>; Thu, 26 Sep 2019 17:20:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id negbKRlbXPLW for <37341-close@debbugs.gnu.org>; Thu, 26 Sep 2019 17:20:48 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-55-104.dynamic.mnet-online.de [188.174.55.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for <37341-close@debbugs.gnu.org>; Thu, 26 Sep 2019 17:20:48 +0200 (CEST) Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id 281F560105 for <37341-close@debbugs.gnu.org>; Thu, 26 Sep 2019 17:23:32 +0200 (CEST) Subject: Re: bug#37341: Acknowledgement ([PATCH 0/2] Add python-distro and debops.) To: 37341-close@debbugs.gnu.org References: <20190908113048.19618-1-h.goebel@crazy-compilers.com> From: Hartmut Goebel Openpgp: preference=signencrypt Organization: crazy-compilers.com Message-ID: Date: Thu, 26 Sep 2019 17:20:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: de-DE X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 37341-close X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Commited as 8581b40d097bf7c0b3016435e0985cf56a003afb and 6eb1d20b682d1256bb4561517daa616b15fec22b. -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | From unknown Mon Aug 11 12:55:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 25 Oct 2019 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator