Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/ansible ansible: parse the output of mount(8)...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fcd6df214517
branches:  trunk
changeset: 436677:fcd6df214517
user:      maya <maya%pkgsrc.org@localhost>
date:      Fri Aug 07 07:40:41 2020 +0000

description:
ansible: parse the output of mount(8) instead of /etc/fstab.
bump PKGREVISION

PR pkg/55544

diffstat:

 sysutils/ansible/Makefile                                                         |   3 +-
 sysutils/ansible/distinfo                                                         |   3 +-
 sysutils/ansible/patches/patch-lib_ansible_module__utils_facts_hardware_netbsd.py |  39 ++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)

diffs (67 lines):

diff -r f7cfa06f8472 -r fcd6df214517 sysutils/ansible/Makefile
--- a/sysutils/ansible/Makefile Fri Aug 07 06:57:24 2020 +0000
+++ b/sysutils/ansible/Makefile Fri Aug 07 07:40:41 2020 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.34 2020/07/29 13:54:07 adam Exp $
+# $NetBSD: Makefile,v 1.35 2020/08/07 07:40:41 maya Exp $
 
 DISTNAME=      ansible-2.9.11
+PKGREVISION=   1
 CATEGORIES=    sysutils python
 MASTER_SITES=  https://releases.ansible.com/ansible/
 
diff -r f7cfa06f8472 -r fcd6df214517 sysutils/ansible/distinfo
--- a/sysutils/ansible/distinfo Fri Aug 07 06:57:24 2020 +0000
+++ b/sysutils/ansible/distinfo Fri Aug 07 07:40:41 2020 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.21 2020/07/29 13:54:07 adam Exp $
+$NetBSD: distinfo,v 1.22 2020/08/07 07:40:41 maya Exp $
 
 SHA1 (ansible-2.9.11.tar.gz) = fc122230ba41a3927d649ab44a49e70084a61d23
 RMD160 (ansible-2.9.11.tar.gz) = e0a05be08ffa67ef7923f7c8d06ee309c9b6accd
 SHA512 (ansible-2.9.11.tar.gz) = b157a5cfb5ba7cb651c7afc0dc92cfe3b8f9eebd06de6d7a1e4917ffca3c542c5207c8e1820acc5be840190c8754f111e2501304ad7e64867247e5b973aec81e
 Size (ansible-2.9.11.tar.gz) = 14243995 bytes
+SHA1 (patch-lib_ansible_module__utils_facts_hardware_netbsd.py) = cdc41b104bffab7badd00446a9d0cdecba32cca2
diff -r f7cfa06f8472 -r fcd6df214517 sysutils/ansible/patches/patch-lib_ansible_module__utils_facts_hardware_netbsd.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/ansible/patches/patch-lib_ansible_module__utils_facts_hardware_netbsd.py Fri Aug 07 07:40:41 2020 +0000
@@ -0,0 +1,39 @@
+$NetBSD: patch-lib_ansible_module__utils_facts_hardware_netbsd.py,v 1.1 2020/08/07 07:40:41 maya Exp $
+
+use mount(8) to get run-time file systems instead of boot-time /etc/fstab
+
+--- lib/ansible/module_utils/facts/hardware/netbsd.py.orig     2020-07-21 01:08:10.000000000 +0000
++++ lib/ansible/module_utils/facts/hardware/netbsd.py
+@@ -116,20 +116,23 @@ class NetBSDHardware(Hardware):
+         mount_facts = {}
+ 
+         mount_facts['mounts'] = []
+-        fstab = get_file_content('/etc/fstab')
++        mount_cmd = self.module.get_bin_path('mount')
+ 
+-        if not fstab:
++        if not mount_cmd:
+             return mount_facts
+ 
+-        for line in fstab.splitlines():
+-            if line.startswith('#') or line.strip() == '':
+-                continue
++        rc, mount_out, err = self.module.run_command(mount_cmd)
++        if rc != 0:
++            return mount_facts
++
++        for line in mount_out.splitlines():
+             fields = re.sub(r'\s+', ' ', line).split()
+-            mount_statvfs_info = get_mount_size(fields[1])
+-            mount_info = {'mount': fields[1],
++            mount_statvfs_info = get_mount_size(fields[2])
++            mount_options = line[line.find("(")+1 : line.find(")")].replace(" ","")
++            mount_info = {'mount': fields[2],
+                           'device': fields[0],
+-                          'fstype': fields[2],
+-                          'options': fields[3]}
++                          'fstype': fields[4],
++                          'options': mount_options}
+             mount_info.update(mount_statvfs_info)
+             mount_facts['mounts'].append(mount_info)
+         return mount_facts



Home | Main Index | Thread Index | Old Index