]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
keepalived: use sh instead of bash for notifier scripts
authorIhar Hrachyshka <ihrachys@redhat.com>
Wed, 11 Feb 2015 16:10:10 +0000 (17:10 +0100)
committerIhar Hrachyshka <ihrachys@redhat.com>
Wed, 11 Feb 2015 16:10:10 +0000 (17:10 +0100)
Those scripts are pretty trivial, calling external commands and using
kill -s and $(...) construction. All that is available in POSIX shell,
so let's not use bash in shebang and utilize more performant shell in
case /bin/sh != /bin/bash (valid for Debian based systems).

Change-Id: Ib5264c5ef51ca9028d7c27d440104a5ab978a557

neutron/agent/linux/keepalived.py

index 19f46c8dc1eaaaf9c3e0528b242a098c14c11042..ef6c9f77e3dd61aa19d41d6454b8f4a7fd0248be 100644 (file)
@@ -311,7 +311,7 @@ class KeepalivedNotifierMixin(object):
         return name
 
     def _prepend_shebang(self, script):
-        return '#!/usr/bin/env bash\n%s' % script
+        return '#!/bin/sh\n%s' % script
 
     def _append_state(self, script, state):
         state_path = self._get_full_config_file_path('state')