SUSE / susecloud-repocheck

SUSECloud Update Infrastructure Check for Azure, AWS, and GCP
GNU General Public License v3.0
22 stars 10 forks source link

Updating EC2 Packages Fails to Strip Newline #45

Open Hummdis opened 2 years ago

Hummdis commented 2 years ago

With version 1.2.9 The following happens on SLES 15 systems:

2022-08-11 21:36:50,445 INFO: Updating infrastructure packages.
/bin/tar: /tmp/late_instance_offline_update_ec2_x86_64\n_SLE15.tar.gz: Cannot open: No such file or directory
/bin/tar: Error is not recoverable: exiting now

2022-08-11 21:36:51,818 INFO: Infrastructure packages updated OK.

Note the newline character after the x86_64 (arch variable). The fix is to add .rstrip() to the end of line 3322 to make it like so:

arch = subprocess.check_output(['uname', '-i']).decode("utf-8").rstrip()

Which then results in it working correctly:

2022-08-11 21:41:02,660 INFO: Attempting to upgrade packages.
2022-08-11 21:41:02,663 INFO: Updating infrastructure packages.
2022-08-11 21:41:04,550 INFO: Infrastructure packages updated OK.

2022-08-11 21:41:04,550 INFO: Package versions OK.