]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Unregistring from Red Hat nearly complete template.
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 11 Oct 2023 11:53:15 +0000 (13:53 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 11 Oct 2023 11:53:15 +0000 (13:53 +0200)
lib/cr_vmware_tpl/handler/vm.py

index 3ba38b335c1583e9b21209817b90235b1e176931..28b5057526549df087da2f4b2ea34ca99ec42f73 100644 (file)
@@ -26,7 +26,7 @@ from fb_tools.errors import HandlerError, ExpectedHandlerError
 from .. import print_section_start, print_section_end
 from ..xlate import XLATOR
 
-__version__ = '0.2.0'
+__version__ = '0.2.1'
 
 LOG = logging.getLogger(__name__)
 
@@ -285,6 +285,7 @@ class HandlerVmMixin():
             '/var/log/wtmp',
             '/var/log/vmware-*.log*',
             '/var/log/yum*.log',
+            '/var/log/rhsm/*.log'
         )
 
         cmd = textwrap.dedent("""\
@@ -302,6 +303,14 @@ class HandlerVmMixin():
             fi
         done
 
+        if [ -x /sbin/subscription-manager ] ; then
+            echo
+            echo "Unregistring current host from Red Hat Subscription Management ..."
+            /sbin/subscription-manager unregister --no-progress-messages
+            sleep 2
+        fi
+
+        echo
         for f in @@@LOGFILES@@@ ; do
             if [ -f "${f}" ] ; then
                 echo "Truncating ${f} ..."