BIND 10 trac1545, updated. d6f3e1aa02ffc1de9d55a586174022eb60f43887 [1545] Corrected problems in setting environment variable in tests

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 14 15:12:07 UTC 2012


The branch, trac1545 has been updated
       via  d6f3e1aa02ffc1de9d55a586174022eb60f43887 (commit)
      from  23ba7abb4e2fe826bf536c822fb7eef20ebcd689 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d6f3e1aa02ffc1de9d55a586174022eb60f43887
Author: Stephen Morris <stephen at isc.org>
Date:   Fri Sep 14 15:16:56 2012 +0100

    [1545] Corrected problems in setting environment variable in tests
    
    For some reason, the Python "os.putenv()" did not work, so changed
    to morifying the "os.environ" variable directly.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/dhcp4/tests/dhcp4_test.py |    8 ++++----
 src/bin/dhcp6/tests/dhcp6_test.py |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/tests/dhcp4_test.py b/src/bin/dhcp4/tests/dhcp4_test.py
index 3ad97c6..efe16fb 100644
--- a/src/bin/dhcp4/tests/dhcp4_test.py
+++ b/src/bin/dhcp4/tests/dhcp4_test.py
@@ -32,11 +32,11 @@ class TestDhcpv4Daemon(unittest.TestCase):
         #
         # However, we do want to set the logging lock directory to somewhere
         # to which we can write - use the current working directory.  We then
-        # set the appropriate environment variable.
+        # set the appropriate environment variable.  os.putenv() doesn't work
+        # on Ubuntu, so we access os.environ directly.
         lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD"
-        lockdir = os.getenv(lockdir_envvar)
-        if lockdir is None:
-            os.putenv(lockdir_envvar, os.getcwd())
+        if lockdir_envvar not in os.environ:
+            os.environ[lockdir_envvar] = os.getcwd()
 
     def tearDown(self):
         pass
diff --git a/src/bin/dhcp6/tests/dhcp6_test.py b/src/bin/dhcp6/tests/dhcp6_test.py
index 0887bbf..78202bd 100644
--- a/src/bin/dhcp6/tests/dhcp6_test.py
+++ b/src/bin/dhcp6/tests/dhcp6_test.py
@@ -32,11 +32,11 @@ class TestDhcpv6Daemon(unittest.TestCase):
         #
         # However, we do want to set the logging lock directory to somewhere
         # to which we can write - use the current working directory.  We then
-        # set the appropriate environment variable.
+        # set the appropriate environment variable.  os.putenv() doesn't work
+        # on Ubuntu, so we access os.environ directly.
         lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD"
-        lockdir = os.getenv(lockdir_envvar)
-        if lockdir is None:
-            os.putenv(lockdir_envvar, os.getcwd())
+        if lockdir_envvar not in os.environ:
+            os.environ[lockdir_envvar] = os.getcwd()
 
     def tearDown(self):
         pass



More information about the bind10-changes mailing list