Skip to contentSkip to conversation

sdk.py: Fix undefined variable

PATCH New Juro Bystricky 1 participant 2 messages Mar 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sdk.py: Fix undefined variable

"sdk_update" uses a variable newsdk_path, which was never declared. This would cause the command:

devtool sdk-update <poky-sdk-latest>

to fail with an error:
NameError: global name 'newsdk_path' is not defined

The remedy is to declare newsdk_path as it was no doubt intended, corresponding to the argument specifying <poky-sdk-latest>.

[YOCTO#9042]

---
 scripts/lib/devtool/sdk.py | 1 +
 1 file changed, 1 insertion(+)
scripts/lib/devtool/sdk.py +1 -0
index fbf2e79..22c5279 100644
@@ -133,6 +133,7 @@ def sdk_update(args, config, basepath, workspace):
             logger.debug("Found conf/locked-sigs.inc in %s" % updateserver)
         update_dict = generate_update_dict(new_locked_sig_file_path, old_locked_sig_file_path)
         logger.debug("update_dict = %s" % update_dict)
+        newsdk_path = updateserver
         sstate_dir = os.path.join(newsdk_path, 'sstate-cache')
         if not os.path.exists(sstate_dir):
             logger.error("sstate-cache directory not found under %s" % newsdk_path)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 sdk_update.py: Enable local sdk-update tests

Testing of local sdk updates was commented out.
Local sdk updates are functional now, so the tests should be re-enabled.

---
 meta/lib/oeqa/sdkext/sdk_update.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/sdkext/sdk_update.py +2 -2
index 16f5b10..7a2a6fe 100644
@@ -30,8 +30,8 @@ class SdkUpdateTest(oeSDKExtTest):
     def test_sdk_update_http(self):
         output = self._run("devtool sdk-update \"%s\"" % self.http_url)
 
-#    def test_sdk_update_local(self):
-#        output = self._run("devtool sdk-update \"%s\"" % self.publish_dir)
+    def test_sdk_update_local(self):
+        output = self._run("devtool sdk-update \"%s\"" % self.publish_dir)
 
     @classmethod
     def tearDownClass(self):
Signature · 1 line
1.9.1