[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH 04/23] oeqa/selftest/wic: use os.rename instead of bb.utils.rename
From:       "Ross Burton" <ross () burtonini ! com>
Date:       2022-03-31 18:28:56
Message-ID: 20220331182915.22128-4-ross.burton () arm ! com
[Download RAW message or body]

Content-Transfer-Encoding: quoted-printable

bb.utils.rename() only exists to handle moves across filesystems. As
these moves are within the same directory we can just use os.rename().

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oeqa/selftest/cases/wic.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 6f3dc277439..673942fc9cc 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -1416,8 +1416,8 @@ class Wic2(WicTestCase):
             result = runCmd("%s/usr/sbin/sfdisk -F %s" % (sysroot, new_image_path))
             self.assertTrue("0 B, 0 bytes, 0 sectors" in result.output)
 
-            bb.utils.rename(image_path, image_path + '.bak')
-            bb.utils.rename(new_image_path, image_path)
+            os.rename(image_path, image_path + '.bak')
+            os.rename(new_image_path, image_path)
 
             # Check if it boots in qemu
             with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
@@ -1428,7 +1428,8 @@ class Wic2(WicTestCase):
             if os.path.exists(new_image_path):
                 os.unlink(new_image_path)
             if os.path.exists(image_path + '.bak'):
-                bb.utils.rename(image_path + '.bak', image_path)
+                os.rename(image_path + '.bak', image_path)
+
 
     def test_wic_ls_ext(self):
         """Test listing content of the ext partition using 'wic ls'"""
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#163845): https://lists.openembedded.org/g/openembedded-core/message/163845
Mute This Topic: https://lists.openembedded.org/mt/90161339/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic