search for: aug_load

Displaying 20 results from an estimated 177 matches for "aug_load".

2010 Feb 16
1
[PATCH] GuestOS: Reload augeas after rpm installation and removal
...100644 --- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm +++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm @@ -862,6 +862,9 @@ sub remove_application $g->command(['rpm', '-e', $name]); }; die($@) if($@); + + # Make augeas reload in case the removal changed anything + $g->aug_load(); } =item get_application_owner(file) @@ -902,6 +905,9 @@ sub _install_rpms # Propagate command failure die($@) if($@); + + # Reload augeas in case the rpm installation changed anything + $g->aug_load(); } # Get full, local path of a file on the transfer mount -- 1.6....
2010 May 13
1
[PATCH] Improve augeas error reporting
...augeas_error($@) if ($@); # Prepend the grub filesystem to the kernel path $kernel = "$grub$kernel" if(defined($grub)); @@ -521,7 +583,11 @@ sub add_kernel $self->_install_rpms(0, ($app)); # Make augeas reload so it'll find the new kernel - $g->aug_load(); + eval { + $g->aug_load(); + }; + + $self->_augeas_error($@) if ($@); return $version; } @@ -603,17 +669,15 @@ sub remove_kernel unless(defined($version)); my $g = $self->{g}; - eval { - # Work out which rpm contains the kernel -...
2014 Oct 24
2
[PATCH] daemon: Remove custom Augeas lenses.
...n (1, 2, 1)) { - int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow", - 0 /* = included */); - if (r == -1) { - AUGEAS_ERROR ("aug_transform"); - aug_close (aug); - aug = NULL; - return -1; - } - - /* If aug_load was implicitly called, reload the handle. */ - if ((flags & AUG_NO_LOAD) == 0) { - if (aug_load (aug) == -1) { - AUGEAS_ERROR ("aug_load"); - return -1; - } - } - } - return 0; } diff --git a/daemon/daemon.h b/daemon/daemon.h index 0ccbc9e..95227d6...
2014 Oct 24
1
[PATCH v2] daemon: Remove custom Augeas lenses.
v2 of previous patch, which fixes some missing bits. For now I'm going to go with Pino's RHEL 7.1 patch, since it is at least smaller than this. So I'm sending this to the list just to have it archived for later. Rich.
2019 May 29
4
[PATCH 0/3] Simple augeas-related changes
- bump the augeas requirement to 1.2.0, and drop an old hack - add a small helper in the generator Pino Toscano (3): build: raise augeas requirement to 1.2.0 appliance: remove custom Shadow augeas lens daemon: implement OptString for OCaml APIs appliance/Makefile.am | 6 +-- appliance/guestfs_shadow.aug | 72 ------------------------------------ daemon/augeas.c | 21
2010 Apr 29
1
[PATCH] GuestOS: Fix augeas grub configuration
...} + } + + # If it wasn't there, add it + unless ($found) { + $g->aug_set("/augeas/load/Grub/incl[last()+1]", + "/boot/grub/menu.lst"); + + # Make augeas pick up the new configuration + $g->aug_load(); } - $g->aug_set("/augeas/load/Grub/incl[last()+1]", "/boot/grub/menu.lst"); - # Make augeas pick up the new configuration - $g->aug_load(); }; # The augeas calls will die() on any error. -- 1.6.6.1
2014 Oct 24
0
Re: [PATCH] daemon: Remove custom Augeas lenses.
...> return -1; > } > > - r = aug_transform (aug, "guestfs_lvm_conf", "/lvm/lvm.conf", > - 0 /* = included */); > - if (r == -1) { > - AUGEAS_ERROR ("aug_transform"); > - return -1; > - } > - > - if (aug_load (aug) == -1) { > - AUGEAS_ERROR ("aug_load"); > - return -1; > - } > - > /* Remove all the old filters ... */ > r = aug_rm (aug, "/files/lvm/lvm.conf/devices/dict/filter/list/*"); > if (r == -1) { Note this part is needed, since within the loca...
2010 May 11
1
[PATCH] GuestOS: Update XF86Config or xorg.conf as appropriate
...l[last()+1]', + '/etc/X11/XF86Config'); + $self->{xorg} = '/etc/X11/XF86Config'; + } else { + $self->{xorg} = '/etc/X11/xorg.conf'; + } + # Make augeas pick up the new configuration $g->aug_load(); }; @@ -287,7 +298,7 @@ sub update_display_driver # Update the display driver if it exists eval { foreach my $path - ($g->aug_match('/files/etc/X11/xorg.conf/Device/Driver')) + ($g->aug_match('/files'.$self->{xorg}.'/Devic...
2010 May 14
1
[PATCH] Use RHN to retrieve replacement packages
...oesn't contain a valid kernel", + path => $app))) if(!defined($version)); - $self->_install_rpms(0, ($app)); + $self->_install_rpms(0, ($app)); + + } # Make augeas reload so it'll find the new kernel eval { - $g->aug_load(); + $self->{g}->aug_load(); }; $self->_augeas_error($@) if ($@); @@ -632,6 +718,7 @@ sub _discover_kernel # Get a current bootable kernel, preferrably the default my $kernel_pkg; + my $kernel_ver; my $kernel_arch; foreach my $i (@configs) { @@...
2011 Feb 01
1
[PATCH] Check for, and uninstall, VMware Tools installed from tarball
...x('VMware Tools was detected, but uninstallation '. + 'failed. The error message was: {error}', + error => $@)) if $@; + + # Reload augeas to detect changed made by vmware tools uninstallation + eval { $g->aug_load() }; + augeas_error($g, $@) if $@; + } } # Get a list of all foreign hypervisor specific kernel modules which are being -- 1.7.3.5
2020 Sep 23
6
[common PATCH 0/3] SELinux_relabel: relabel only if enforcing (RHBZ#1828952)
Continuation/rework of: https://www.redhat.com/archives/libguestfs/2020-May/msg00020.html This is my approach, as I explained here: https://bugzilla.redhat.com/show_bug.cgi?id=1828952#c4 https://www.redhat.com/archives/libguestfs/2020-May/msg00035.html IOW: do not attempt to relabel if the guest is not enforcing, as it is either useless or may fail; few words more are in the comments of patch #3.
2016 Sep 16
1
[PATCH v4] v2v: linux: correctly reconfigure the initrd on Debian
...+ * /etc/initramfs-tools/modules + * File format is same as modules(5). + *) + let file = "/etc/initramfs-tools/modules" in + let path = sprintf "/files%s" file in + g#aug_transform "modules" file; + g#aug_load (); + g#aug_set (sprintf "%s/#comment[last()+1]" path) + "The following modules were added by virt-v2v"; + List.iter ( + fun m -> g#aug_clear (sprintf "%s/%s" path m) + ) modules; + g#aug_save (); + );...
2015 Oct 15
1
[PATCH v2] inspect: check for errors in files parsed with augeas (RHBZ#1229119)
During the inspection phase, check for errors after aug_load: if any of the errors happened in any of the requested files, then report the error straight away; ignoring the error means that information would be silently lost. For example, a malformed /etc/fstab would have caused the inspection to not handle any of the additional mount points, giving cryptic...
2014 Oct 24
1
[PATCH v3] daemon: Remove custom Augeas lenses.
v3: - Don't remove the LVM transform.
2011 Dec 07
2
failure converting Linux ESX guest to KVM hypervisor
...;/augeas/load/Grub/incl[2]"] libguestfs: trace: aug_get "/augeas/load/Grub/incl[1]" libguestfs: trace: aug_get = "/etc/grub.conf" libguestfs: trace: aug_get "/augeas/load/Grub/incl[2]" libguestfs: trace: aug_get = "/boot/grub/menu.lst" libguestfs: trace: aug_load libguestfs: trace: aug_load = 0 libguestfs: trace: exists "/etc/conf.modules" libguestfs: trace: exists = 0 libguestfs: trace: exists "/etc/modules.conf" libguestfs: trace: exists = 0 libguestfs: trace: exists "/etc/modprobe.conf" libguestfs: trace: exists = 0 libguest...
2014 Sep 04
10
[PATCH 0/5] use augeas for /etc/shadow
Hi, currently /etc/shadow is edited manually when needed (i.e. when setting the password for an user), and it is not changed when removing users. Import the upstream shadow.aug (currently in their development serie, but not part of any released version yet), and use it only when the augeas version is less than a potential 1.2.1 (covering also the case when the new version is just 1.3.0). Pino
2019 Jan 30
1
[PATCH v3] v2v: linux: use NEVR for querying RPM packages (RHBZ#1669395)
...changed, 38 insertions(+), 21 deletions(-) diff --git a/v2v/linux.ml b/v2v/linux.ml index 43449157b..99b0e0e7b 100644 --- a/v2v/linux.ml +++ b/v2v/linux.ml @@ -27,6 +27,8 @@ open Utils module G = Guestfs +let re_version = PCRE.compile "(\\d+)\\.(\\d+)" + let augeas_reload g = g#aug_load (); debug_augeas_errors g @@ -80,29 +82,44 @@ let file_list_of_package (g : Guestfs.guestfs) inspect app = | "rpm" -> (* Since RPM allows multiple packages installed with the same - * name, always check the full ENVR here (RHBZ#1161250). + * name, always check the...
2018 Nov 06
2
Re: [PATCH 2/3] v2v: linux: install packages
.../linux.ml | 19 +++++++++++++++++++ > v2v/linux.mli | 3 +++ > 2 files changed, 22 insertions(+) > > diff --git a/v2v/linux.ml b/v2v/linux.ml > index 177724e39..6a5cae512 100644 > --- a/v2v/linux.ml > +++ b/v2v/linux.ml > @@ -31,6 +31,25 @@ let augeas_reload g = > g#aug_load (); > debug_augeas_errors g > > +let rec install g inspect packages = > + if packages <> [] then ( > + do_install g inspect packages; > + (* Reload Augeas in case anything changed. *) > + augeas_reload g > + ) > + > +and do_install g { i_package_f...
2019 Jan 30
1
[PATCH v2] v2v: linux: use NEVR for querying RPM packages (RHBZ#1669395)
...changed, 34 insertions(+), 21 deletions(-) diff --git a/v2v/linux.ml b/v2v/linux.ml index 43449157b..63489c334 100644 --- a/v2v/linux.ml +++ b/v2v/linux.ml @@ -27,6 +27,8 @@ open Utils module G = Guestfs +let re_version = PCRE.compile "(\\d+)\\.(\\d+)" + let augeas_reload g = g#aug_load (); debug_augeas_errors g @@ -80,29 +82,40 @@ let file_list_of_package (g : Guestfs.guestfs) inspect app = | "rpm" -> (* Since RPM allows multiple packages installed with the same - * name, always check the full ENVR here (RHBZ#1161250). + * name, always check the...
2020 May 05
3
[PATCH libguestfs-common 1/2] mlcustomize: Refactor SELinux_relabel code.
...g#aug_init "/" (16+32) (* AUG_SAVE_NOOP | AUG_NO_LOAD *); - (* See: https://bugzilla.redhat.com/show_bug.cgi?id=975412#c0 *) - ignore (g#aug_rm "/augeas/load/*[\"/etc/selinux/config/\" !~ regexp('^') + glob(incl) + regexp('/.*')]"); - g#aug_load (); - debug_augeas_errors g; - - (* Get the SELinux policy name, eg. "targeted", "minimum". - * Use "targeted" if not specified, just like libselinux does. +let rec relabel (g : G.guestfs) = + (* Is the guest using SELinux? (Otherwise this is a no-op)...