Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package google-osconfig-agent for 
openSUSE:Factory checked in at 2022-10-22 17:09:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/google-osconfig-agent (Old)
 and      /work/SRC/openSUSE:Factory/.google-osconfig-agent.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "google-osconfig-agent"

Sat Oct 22 17:09:42 2022 rev:17 rq:1030536 version:20221013.01

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/google-osconfig-agent/google-osconfig-agent.changes  
    2022-10-11 18:05:23.218069012 +0200
+++ 
/work/SRC/openSUSE:Factory/.google-osconfig-agent.new.2275/google-osconfig-agent.changes
    2022-10-22 17:09:43.661193718 +0200
@@ -1,0 +2,8 @@
+Fri Oct 21 13:12:03 UTC 2022 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- Update to version 20221013.01
+  * Don't print raw pointer data. (#446)
+- from version 20221013.00
+  * Delete yum transaction files if created. (#445)
+
+-------------------------------------------------------------------

Old:
----
  osconfig-20220829.00.tar.gz

New:
----
  osconfig-20221013.01.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ google-osconfig-agent.spec ++++++
--- /var/tmp/diff_new_pack.M8yVBm/_old  2022-10-22 17:09:44.625195282 +0200
+++ /var/tmp/diff_new_pack.M8yVBm/_new  2022-10-22 17:09:44.633195295 +0200
@@ -24,7 +24,7 @@
 %global import_path     %{provider_prefix}
 
 Name:           google-osconfig-agent
-Version:        20220829.00
+Version:        20221013.01
 Release:        0
 Summary:        Google Cloud Guest Agent
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.M8yVBm/_old  2022-10-22 17:09:44.673195359 +0200
+++ /var/tmp/diff_new_pack.M8yVBm/_new  2022-10-22 17:09:44.677195366 +0200
@@ -3,8 +3,8 @@
     <param name="url">https://github.com/GoogleCloudPlatform/osconfig</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="versionformat">20220829.00</param>
-    <param name="revision">20220829.00</param>
+    <param name="versionformat">20221013.01</param>
+    <param name="revision">20221013.01</param>
     <param name="changesgenerate">enable</param>
   </service>
   <service name="recompress" mode="disabled">
@@ -15,7 +15,7 @@
     <param name="basename">osconfig</param>
   </service>
   <service name="go_modules" mode="disabled">
-    <param name="archive">osconfig-20220829.00.tar.gz</param>
+    <param name="archive">osconfig-20221013.01.tar.gz</param>
   </service>
 </services>
 

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.M8yVBm/_old  2022-10-22 17:09:44.701195405 +0200
+++ /var/tmp/diff_new_pack.M8yVBm/_new  2022-10-22 17:09:44.705195411 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/GoogleCloudPlatform/osconfig</param>
-              <param 
name="changesrevision">d29dee5600778aac20a266f6c97b3b4297d9bbca</param></service></servicedata>
+              <param 
name="changesrevision">01d06e505026f34d8765dc4e1c2837d2f86417a3</param></service></servicedata>
 (No newline at EOF)
 

++++++ osconfig-20220829.00.tar.gz -> osconfig-20221013.01.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osconfig-20220829.00/agentendpoint/inventory.go 
new/osconfig-20221013.01/agentendpoint/inventory.go
--- old/osconfig-20220829.00/agentendpoint/inventory.go 2022-08-29 
16:08:52.000000000 +0200
+++ new/osconfig-20221013.01/agentendpoint/inventory.go 2022-10-13 
23:34:03.000000000 +0200
@@ -49,7 +49,7 @@
                case reflect.Ptr:
                        switch reflect.Indirect(f).Kind() {
                        case reflect.Struct:
-                               clog.Debugf(ctx, "postAttributeCompressed %s: 
%+v", u, f)
+                               clog.Debugf(ctx, "postAttributeCompressed %s", 
u)
                                if err := attributes.PostAttributeCompressed(u, 
f.Interface()); err != nil {
                                        clog.Errorf(ctx, 
"postAttributeCompressed error: %v", err)
                                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osconfig-20220829.00/packages/yum.go 
new/osconfig-20221013.01/packages/yum.go
--- old/osconfig-20220829.00/packages/yum.go    2022-08-29 16:08:52.000000000 
+0200
+++ new/osconfig-20221013.01/packages/yum.go    2022-10-13 23:34:03.000000000 
+0200
@@ -18,9 +18,12 @@
        "bytes"
        "context"
        "fmt"
+       "os"
        "os/exec"
        "runtime"
+       "strings"
 
+       "github.com/GoogleCloudPlatform/osconfig/clog"
        "github.com/GoogleCloudPlatform/osconfig/osinfo"
        "github.com/GoogleCloudPlatform/osconfig/util"
 )
@@ -131,6 +134,25 @@
        return pkgs
 }
 
+func getYumTXFile(data []byte) string {
+       /* The last lines of a non-complete yum update where the transaction
+          is saved look like:
+
+            Exiting on user command
+            Your transaction was saved, rerun it with:
+             yum load-transaction 
/tmp/yum_save_tx.2022-10-12.20-26.j3auah.yumtx
+       */
+       lines := bytes.Split(bytes.TrimSpace(data), []byte("\n"))
+
+       for _, ln := range lines {
+               flds := bytes.Fields(ln)
+               if len(flds) == 3 && string(flds[1]) == "load-transaction" && 
strings.HasPrefix(string(flds[2]), "/tmp/yum_save_tx.") {
+                       return string(flds[2])
+               }
+       }
+       return ""
+}
+
 // YumUpdates queries for all available yum updates.
 func YumUpdates(ctx context.Context, opts ...YumUpdateOption) ([]*PkgInfo, 
error) {
        // We just use check-update to ensure all repo keys are synced as we run
@@ -180,6 +202,16 @@
                return nil, nil
        }
 
+       // Some versions of yum will leave a transaction file in /tmp when 
update
+       // is run with --assumeno. This will attempt to delete that file.
+       yumTXFile := getYumTXFile(stdout)
+       if yumTXFile != "" {
+               clog.Debugf(ctx, "Removing yum tx file: %s", yumTXFile)
+               if err := os.Remove(yumTXFile); err != nil {
+                       clog.Debugf(ctx, "Error deleting yum tx file %s: %v", 
yumTXFile, err)
+               }
+       }
+
        pkgs := parseYumUpdates(stdout)
        if len(pkgs) == 0 {
                // This means we could not parse any packages and instead got 
an error from yum.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/osconfig-20220829.00/packages/yum_test.go 
new/osconfig-20221013.01/packages/yum_test.go
--- old/osconfig-20220829.00/packages/yum_test.go       2022-08-29 
16:08:52.000000000 +0200
+++ new/osconfig-20221013.01/packages/yum_test.go       2022-10-13 
23:34:03.000000000 +0200
@@ -219,3 +219,69 @@
                })
        }
 }
+
+func TestGetYumTX(t *testing.T) {
+       dataWithTX := []byte(`
+       
=================================================================================================================================================================================
+       Package                                      Arch                       
    Version                                              Repository             
                   Size
+       
=================================================================================================================================================================================
+       Installing:
+         kernel                                    x86_64                      
   2.6.32-754.24.3.el6                                  updates                 
                  32 M
+          replacing kernel.x86_64 1.0.0-4
+       Upgrading:
+         foo                                       noarch                      
   2.0.0-1                                              BaseOS                  
                 361 k
+         bar                                       x86_64                      
   2.0.0-1                                              repo                    
                  10 M
+       Obsoleting:
+         baz                                       noarch                      
   2.0.0-1                                              repo                    
                  10 M
+
+       Transaction Summary
+       
=================================================================================================================================================================================
+       Upgrade  11 Packages
+
+       Total download size: 106 M
+       Exiting on user command
+       Your transaction was saved, rerun it with:
+        yum load-transaction /tmp/yum_save_tx.abcdef.yumtx
+       `)
+       dataNoTX := []byte(`
+       
=================================================================================================================================================================================
+       Package                                      Arch                       
    Version                                              Repository             
                   Size
+       
=================================================================================================================================================================================
+       Installing:
+       kernel                                    x86_64                        
 2.6.32-754.24.3.el6                                  updates                   
                32 M
+       replacing kernel.x86_64 1.0.0-4
+       Upgrading:
+       foo                                       noarch                        
 2.0.0-1                                              BaseOS                    
               361 k
+       bar                                       x86_64                        
 2.0.0-1                                              repo                      
                10 M
+       Obsoleting:
+       baz                                       noarch                        
 2.0.0-1                                              repo                      
                10 M
+
+       Transaction Summary
+       
=================================================================================================================================================================================
+       Upgrade  11 Packages
+       `)
+       dataUnexpected := []byte(`
+       Exiting on user command
+       Your transaction was saved, rerun it with:
+        yum load-transaction /tmp/otherfilename
+       `)
+
+       tests := []struct {
+               name string
+               data []byte
+               want string
+       }{
+               {"Transaction created", dataWithTX, 
"/tmp/yum_save_tx.abcdef.yumtx"},
+               {"Transaction not created", dataNoTX, ""},
+               {"Unexpected Filename", dataUnexpected, ""},
+       }
+
+       for _, tt := range tests {
+               t.Run(tt.name, func(t *testing.T) {
+                       if got := getYumTXFile(tt.data); got != tt.want {
+                               t.Errorf("%s: getYumTXFile() = %v, want %v", 
tt.name, got, tt.want)
+                       }
+               })
+       }
+
+}

++++++ vendor.tar.gz ++++++

Reply via email to