diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 415: release-0.19.2

Message ID 20121023052815.18357.2658.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Andy Doan Oct. 23, 2012, 5:28 a.m. UTC
------------------------------------------------------------
revno: 415
committer: Andy Doan <andy.doan@linaro.org>
branch nick: lava-dispatcher
timestamp: Mon 2012-10-22 23:46:20 -0500
message:
  release-0.19.2
  
  fix openembedded file permission issue
modified:
  lava_dispatcher/__init__.py
  lava_dispatcher/actions/lava_test_shell.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/__init__.py'
--- lava_dispatcher/__init__.py	2012-10-23 03:21:33 +0000
+++ lava_dispatcher/__init__.py	2012-10-23 04:46:20 +0000
@@ -18,4 +18,4 @@ 
 # along
 # with this program; if not, see <http://www.gnu.org/licenses>.
 
-__version__ = (0, 19, 1, "final", 0)
+__version__ = (0, 19, 2, "final", 0)

=== modified file 'lava_dispatcher/actions/lava_test_shell.py'
--- lava_dispatcher/actions/lava_test_shell.py	2012-10-18 19:46:30 +0000
+++ lava_dispatcher/actions/lava_test_shell.py	2012-10-23 04:46:20 +0000
@@ -61,6 +61,10 @@ 
 Target.oe_deployment_data['lava_test_dir'] = '/lava'
 Target.oe_deployment_data['lava_test_results_part_attr'] = 'root_part'
 
+# 755 file permissions
+XMOD = stat.S_IRWXU | stat.S_IXGRP | stat.S_IRGRP | stat.S_IXOTH | stat.S_IROTH
+
+
 def _configure_ubuntu_startup(etcdir):
     logging.info('adding ubuntu upstart job')
     shutil.copy(LAVA_TEST_UPSTART, '%s/init/' % etcdir)
@@ -71,9 +75,11 @@ 
 
 def _configure_oe_startup(etcdir):
     logging.info('adding init.d script')
-    shutil.copy(LAVA_TEST_INITD, '%s/init.d/lava-test-runner' % etcdir)
-    shutil.copy(LAVA_TEST_INITD, '%s/rc5.d/S50lava-test-runner' % etcdir)
-    shutil.copy(LAVA_TEST_INITD, '%s/rc6.d/K50lava-test-runner' % etcdir)
+    initd_file = '%s/init.d/lava-test-runner' % etcdir
+    shutil.copy(LAVA_TEST_INITD, initd_file)
+    os.chmod(initd_file, XMOD)
+    shutil.copy(initd_file, '%s/rc5.d/S50lava-test-runner' % etcdir)
+    shutil.copy(initd_file, '%s/rc6.d/K50lava-test-runner' % etcdir)
 
 Target.oe_deployment_data['lava_test_configure_startup'] = \
         _configure_oe_startup
@@ -128,17 +134,16 @@ 
             return json.load(f)
 
     def _copy_runner(self, mntdir, target):
-        xmod = (stat.S_IRWXU | stat.S_IXGRP | stat.S_IRGRP |
-                stat.S_IXOTH | stat.S_IROTH)
         runner = target.deployment_data['lava_test_runner']
         shell = target.deployment_data['lava_test_shell']
         shutil.copy(runner, '%s/bin/lava-test-runner' % mntdir)
+        os.chmod('%s/bin/lava-test-runner' % mntdir, XMOD)
         with open(shell, 'r') as fin:
             with open('%s/bin/lava-test-shell' % mntdir, 'w') as fout:
                 shcmd = target.deployment_data['lava_test_sh_cmd']
                 fout.write("#!%s\n\n" % shcmd)
                 fout.write(fin.read())
-                os.fchmod(fout.fileno(), xmod)
+                os.fchmod(fout.fileno(), XMOD)
 
     def _bzr_info(self, url, bzrdir):
         cwd = os.getcwd()